Skip to content

Commit 1b6a7d4

Browse files
committed
add esm builds
1 parent cf7b90f commit 1b6a7d4

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

build/config.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,22 @@ const builds = {
3838
alias: { he: './entity-decoder' },
3939
banner
4040
},
41+
// Runtime only (ES Modules). Used by bundlers that support ES Modules,
42+
// e.g. Rollup & Webpack 2
43+
'web-runtime-esm': {
44+
entry: path.resolve(__dirname, '../src/entries/web-runtime.js'),
45+
dest: path.resolve(__dirname, '../dist/vue.runtime.esm.js'),
46+
format: 'es',
47+
banner
48+
},
49+
// Runtime+compiler CommonJS build (ES Modules)
50+
'web-full-esm': {
51+
entry: path.resolve(__dirname, '../src/entries/web-runtime-with-compiler.js'),
52+
dest: path.resolve(__dirname, '../dist/vue.esm.js'),
53+
format: 'es',
54+
alias: { he: './entity-decoder' },
55+
banner
56+
},
4157
// runtime-only build (Browser)
4258
'web-runtime-dev': {
4359
entry: path.resolve(__dirname, '../src/entries/web-runtime.js'),

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
"version": "2.2.0-beta.2",
44
"description": "Reactive, component-oriented view layer for modern web interfaces.",
55
"main": "dist/vue.runtime.common.js",
6+
"module": "dist/vue.runtime.esm.js",
7+
"unpkg": "dist/vue.js",
68
"typings": "types/index.d.ts",
79
"files": [
810
"dist/vue.js",
@@ -117,6 +119,5 @@
117119
"webpack": "^2.2.0",
118120
"weex-js-runtime": "^0.17.0-alpha4",
119121
"weex-vdom-tester": "^0.1.4"
120-
},
121-
"unpkg": "dist/vue.js"
122+
}
122123
}

0 commit comments

Comments
 (0)