With Babel we are able to leverage all the newest language features in ES2015+, but that also means we have to ship transpiled and polyfilled bundles in order to support older browsers.
I think this feature is quite useful for development of browser extensions, since we can use there the latest es6 features without fear to break something. Moreover, we can get smaller bundle size and better browser performance.
Expected behaviour
Following vue cli 3 command should work:
vue-cli-service build --modern
What is actually happening?
When I install browser-extension plugin the command above fails.
Error output
ERROR TypeError: Cannot read property '0' of undefined
TypeError: Cannot read property '0' of undefined
at /home/kryvonos_v/projects/hello-world/node_modules/vue-cli-plugin-browser-extension/index.js:112:14
at Object.tap (/home/kryvonos_v/projects/hello-world/node_modules/webpack-chain/src/Plugin.js:24:24)
at /home/kryvonos_v/projects/hello-world/node_modules/vue-cli-plugin-browser-extension/index.js:111:34
at /home/kryvonos_v/projects/hello-world/node_modules/@vue/cli-service/lib/Service.js:242:40
at Array.forEach (<anonymous>)
at Service.resolveChainableWebpackConfig (/home/kryvonos_v/projects/hello-world/node_modules/@vue/cli-service/lib/Service.js:242:26)
at PluginAPI.resolveChainableWebpackConfig (/home/kryvonos_v/projects/hello-world/node_modules/@vue/cli-service/lib/PluginAPI.js:151:25)
at module.exports (/home/kryvonos_v/projects/hello-world/node_modules/@vue/cli-service/lib/commands/build/resolveAppConfig.js:2:22)
at build (/home/kryvonos_v/projects/hello-world/node_modules/@vue/cli-service/lib/commands/build/index.js:146:50)
at /home/kryvonos_v/projects/hello-world/node_modules/@vue/cli-service/lib/commands/build/index.js:58:15
at Service.run (/home/kryvonos_v/projects/hello-world/node_modules/@vue/cli-service/lib/Service.js:236:12)
at Object.<anonymous> (/home/kryvonos_v/projects/hello-world/node_modules/@vue/cli-service/bin/vue-cli-service.js:37:9)
at Module._compile (internal/modules/cjs/loader.js:777:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:788:10)
at Module.load (internal/modules/cjs/loader.js:643:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
Made an update that I think resolves your build issues. Are you able to pull it down and confirm that it builds like you expect before I publish a release?
From vue cli 3 docs, about modern mode:
I think this feature is quite useful for development of browser extensions, since we can use there the latest es6 features without fear to break something. Moreover, we can get smaller bundle size and better browser performance.
Expected behaviour
Following vue cli 3 command should work:
What is actually happening?
When I install
browser-extension
plugin the command above fails.Error output