فهرست منبع

add esm builds

Evan You 9 سال پیش
والد
کامیت
1b6a7d4b87
2فایلهای تغییر یافته به همراه19 افزوده شده و 2 حذف شده
  1. 16 0
      build/config.js
  2. 3 2
      package.json

+ 16 - 0
build/config.js

@@ -38,6 +38,22 @@ const builds = {
     alias: { he: './entity-decoder' },
     banner
   },
+  // Runtime only (ES Modules). Used by bundlers that support ES Modules,
+  // e.g. Rollup & Webpack 2
+  'web-runtime-esm': {
+    entry: path.resolve(__dirname, '../src/entries/web-runtime.js'),
+    dest: path.resolve(__dirname, '../dist/vue.runtime.esm.js'),
+    format: 'es',
+    banner
+  },
+  // Runtime+compiler CommonJS build (ES Modules)
+  'web-full-esm': {
+    entry: path.resolve(__dirname, '../src/entries/web-runtime-with-compiler.js'),
+    dest: path.resolve(__dirname, '../dist/vue.esm.js'),
+    format: 'es',
+    alias: { he: './entity-decoder' },
+    banner
+  },
   // runtime-only build (Browser)
   'web-runtime-dev': {
     entry: path.resolve(__dirname, '../src/entries/web-runtime.js'),

+ 3 - 2
package.json

@@ -3,6 +3,8 @@
   "version": "2.2.0-beta.2",
   "description": "Reactive, component-oriented view layer for modern web interfaces.",
   "main": "dist/vue.runtime.common.js",
+  "module": "dist/vue.runtime.esm.js",
+  "unpkg": "dist/vue.js",
   "typings": "types/index.d.ts",
   "files": [
     "dist/vue.js",
@@ -117,6 +119,5 @@
     "webpack": "^2.2.0",
     "weex-js-runtime": "^0.17.0-alpha4",
     "weex-vdom-tester": "^0.1.4"
-  },
-  "unpkg": "dist/vue.js"
+  }
 }