Skip to content

Commit 5eb7b9d

Browse files
committed
Create an esm build to use as pkg.module
Not transpiling the pkg.module file can be frustrating to the users of this package, see: https://goo.gl/k7z2KQ Fixes #11
1 parent 6d72e03 commit 5eb7b9d

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111
"homepage": "https://github.com/maoberlehner/vuex-map-fields",
1212
"license": "MIT",
1313
"scripts": {
14-
"scripts:bundle": "rollup --config --output.format umd --name vuex-map-fields --output.file dist/index.js src/index.js",
15-
"scripts:minify": "uglifyjs --compress --mangle --comments --output dist/index.min.js dist/index.js",
16-
"scripts": "npm run scripts:bundle && npm run scripts:minify",
14+
"scripts:umd": "rollup --config --output.format umd --name vuex-map-fields --output.file dist/index.js src/index.js",
15+
"scripts:es": "rollup --config --output.format es --name vuex-map-fields --output.file dist/index.esm.js src/index.js",
16+
"scripts:minify": "uglifyjs --compress --mangle --comments --output dist/index.min.js dist/index.js && uglifyjs --compress --mangle --comments --output dist/index.esm.min.js dist/index.esm.js",
17+
"scripts": "npm run scripts:umd && npm run scripts:es && npm run scripts:minify",
1718
"build": "npm run scripts",
1819
"fake-publish": "npm run build && sh test/utils/fake-publish.sh",
1920
"lint": "npm run fake-publish && eslint --ignore-path .gitignore .",
@@ -36,13 +37,13 @@
3637
"rollup": "^0.56.2",
3738
"rollup-plugin-babel": "^3.0.3",
3839
"rollup-plugin-node-resolve": "^3.0.3",
39-
"uglify-js": "^3.3.11",
40+
"uglify-es": "^3.3.9",
4041
"vue": "^2.5.13",
4142
"vue-template-compiler": "^2.5.13",
4243
"vuex": "^3.0.1"
4344
},
4445
"main": "dist/index.js",
45-
"module": "src/index.js",
46+
"module": "dist/index.esm.js",
4647
"repository": {
4748
"type": "git",
4849
"url": "https://github.com/maoberlehner/vuex-map-fields"

test/packaged.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
getField as getFieldSrc,
1010
mapFields as mapFieldsSrc,
1111
updateField as updateFieldSrc,
12-
} from './package/src';
12+
} from './package/dist/index.esm';
1313

1414
import {
1515
getField as getFieldDist,

0 commit comments

Comments
 (0)