diff --git a/build/config.js b/build/config.js index b0c705e4d1a..d3069765991 100644 --- a/build/config.js +++ b/build/config.js @@ -58,7 +58,7 @@ const builds = { format: 'es', banner }, - // Runtime+compiler CommonJS build (ES Modules) + // Runtime+compiler ES modules build (for bundlers) 'web-full-esm': { entry: resolve('web/entry-runtime-with-compiler.js'), dest: resolve('dist/vue.esm.js'), @@ -66,6 +66,16 @@ const builds = { alias: { he: './entity-decoder' }, banner }, + // Runtime+compiler ES modules build (for direct import in browser) + 'web-full-esm-browser': { + entry: resolve('web/entry-runtime-with-compiler.js'), + dest: resolve('dist/vue.esm.browser.js'), + format: 'es', + transpile: false, + env: 'development', + alias: { he: './entity-decoder' }, + banner + }, // runtime-only build (Browser) 'web-runtime-dev': { entry: resolve('web/entry-runtime.js'), @@ -180,7 +190,6 @@ function genConfig (name) { __VERSION__: version }), flow(), - buble(), alias(Object.assign({}, aliases, opts.alias)) ].concat(opts.plugins || []), output: { @@ -197,6 +206,10 @@ function genConfig (name) { })) } + if (opts.transpile !== false) { + config.plugins.push(buble()) + } + Object.defineProperty(config, '_name', { enumerable: false, value: name