mirror of
https://github.com/zhigang1992/mobx-utils.git
synced 2026-01-12 17:32:29 +08:00
replace long rollup cli with rollup.config.js
This commit is contained in:
@@ -3,14 +3,14 @@
|
||||
"version": "5.6.0",
|
||||
"description": "Utility functions and common patterns for MobX",
|
||||
"main": "mobx-utils.umd.js",
|
||||
"module": "lib/mobx-utils.js",
|
||||
"module": "mobx-utils.module.js",
|
||||
"jsnext:main": "mobx-utils.module.js",
|
||||
"react-native": "mobx-utils.module.js",
|
||||
"typings": "lib/mobx-utils.d.ts",
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"prettier": "prettier --write \"**/*.js\" \"**/*.jsx\" \"**/*.tsx\" \"**/*.ts\"",
|
||||
"build": "tsc -p src && rollup lib/mobx-utils.js -e mobx -g mobx:mobx -o mobx-utils.umd.js -f umd --name mobxUtils && rollup lib/mobx-utils.js -e mobx -o mobx-utils.module.js -f es",
|
||||
"build": "tsc -p src && rollup -c",
|
||||
"watch": "jest --watch",
|
||||
"test": "jest",
|
||||
"prepublishOnly": "npm run build && npm run build-docs",
|
||||
|
||||
24
rollup.config.js
Normal file
24
rollup.config.js
Normal file
@@ -0,0 +1,24 @@
|
||||
export default {
|
||||
input: "lib/mobx-utils.js",
|
||||
output: [
|
||||
{
|
||||
format: "umd",
|
||||
file: "mobx-utils.umd.js",
|
||||
name: "mobxUtils",
|
||||
globals: {
|
||||
mobx: "mobx",
|
||||
},
|
||||
},
|
||||
{
|
||||
format: "es",
|
||||
file: "mobx-utils.module.js",
|
||||
},
|
||||
],
|
||||
external: ["mobx"],
|
||||
onwarn: function (warning, warn) {
|
||||
// https://github.com/rollup/rollup/wiki/Troubleshooting#this-is-undefined
|
||||
if ("THIS_IS_UNDEFINED" === warning.code) return
|
||||
|
||||
warn(warning)
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user