Closed
Description
Version
4.0.4
Environment info
Environment Info:
System:
OS: Linux 4.9 Debian GNU/Linux 9 (stretch) 9 (stretch)
CPU: (12) x64 Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz
Binaries:
Node: 10.16.3 - /usr/bin/node
Yarn: Not Found
npm: 6.12.0 - /usr/bin/npm
Browsers:
Chrome: 77.0.3865.90
Firefox: 60.8.0
npmPackages:
@vue/babel-helper-vue-jsx-merge-props: 1.0.0
@vue/babel-plugin-transform-vue-jsx: 1.0.0
@vue/babel-preset-app: 4.0.2
@vue/babel-preset-jsx: 1.1.1
@vue/babel-sugar-functional-vue: 1.0.0
@vue/babel-sugar-inject-h: 1.0.0
@vue/babel-sugar-v-model: 1.1.1
@vue/babel-sugar-v-on: 1.1.0
@vue/cli-overlay: 4.0.2
@vue/cli-plugin-babel: ^4.0.0 => 4.0.2
@vue/cli-plugin-router: ^4.0.0 => 4.0.2
@vue/cli-plugin-vuex: ^4.0.0 => 4.0.2
@vue/cli-service: ^4.0.0 => 4.0.2
@vue/cli-shared-utils: 4.0.2
@vue/component-compiler-utils: 3.0.0
@vue/preload-webpack-plugin: 1.1.1
@vue/web-component-wrapper: 1.2.0
vue: ^2.6.10 => 2.6.10
vue-hot-reload-api: 2.3.4
vue-loader: 15.7.1
vue-router: ^3.0.6 => 3.1.3
vue-style-loader: 4.1.2
vue-template-compiler: ^2.6.10 => 2.6.10
vue-template-es2015-compiler: 1.9.1
vuex: ^3.0.1 => 3.1.1
npmGlobalPackages:
@vue/cli: 4.0.4
Steps to reproduce
Create a brand new project with Vue CLI 4.
Install webpack-bundle-analyzer and build. Only core-js is included in the bundle.
Open src/main.js and add the following to the Vue instance:
methods: {
myfunc: async function () {},
},
Build with webpack-bundle-analyzer again. Now both core-js and core-js-pure are imported and there are a lot of duplicated imports between them.
What is expected?
Do not duplicate imports from core-js and core-js-pure.
What is actually happening?
The same imports are duplicated between core-js and core-js-pure.
Is this actually a bug or is it intended? I'm reporting it as a bug since it doesn't seem normal to me and I didn't have such problems with Vue CLI 3. I'd be happy if someone explained the reasoning behind this.