runtimeCompiler causes rewriting of some dependencies in chunk-vendors to use ES6 syntax
See original GitHub issueVersion
3.9.0
Environment info
System:
OS: macOS 10.14
Binaries:
Node: 10.15.2 - /opt/local/bin/node
Yarn: 1.16.0 - /opt/local/bin/yarn
npm: 6.9.2 - /opt/local/bin/npm
Browsers:
npmPackages:
@vue/babel-helper-vue-jsx-merge-props: 1.0.0
@vue/babel-plugin-transform-vue-jsx: 1.0.0
@vue/babel-preset-app: 3.9.0
@vue/babel-preset-jsx: 1.0.0
@vue/babel-sugar-functional-vue: 1.0.0
@vue/babel-sugar-inject-h: 1.0.0
@vue/babel-sugar-v-model: 1.0.0
@vue/babel-sugar-v-on: 1.0.0
@vue/cli-overlay: 3.9.0
@vue/cli-plugin-babel: ^3.9.0 => 3.9.0
@vue/cli-plugin-eslint: ^3.9.0 => 3.9.1
@vue/cli-plugin-unit-mocha: ^3.9.0 => 3.9.0
@vue/cli-service: ^3.9.0 => 3.9.0
@vue/cli-shared-utils: 3.9.0
@vue/component-compiler-utils: 2.6.0
@vue/eslint-config-prettier: ^4.0.1 => 4.0.1
@vue/preload-webpack-plugin: 1.1.0
@vue/test-utils: 1.0.0-beta.29 => 1.0.0-beta.29
@vue/web-component-wrapper: 1.2.0
eslint-plugin-vue: ^5.0.0 => 5.2.3 (4.7.1)
vue: ^2.6.10 => 2.6.10
vue-eslint-parser: 2.0.3 (5.0.0)
vue-hot-reload-api: 2.3.3
vue-loader: 15.7.0
vue-router: ^3.0.3 => 3.0.7
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: 3.8.4
Steps to reproduce
Create a ‘hello-world’ app with vue-cli (all defaults). Add a vue.config.js file. Build. Observe that the ‘chunk-vendors’ file contains no arrow functions. Set ’ runtimeCompiler: true’ in the vue.config.js file. Build. Observe that one of the dependencies in the ‘chunk-vendors’ file contains arrow functions.
What is expected?
The ‘chunk-vendors’ file contains no arrow functions.
What is actually happening?
The ‘chunk-vendors’ file contains arrow functions.
Initially, I saw this because the project wouldn’t run in IE. I thought that this was because of the Babel/node_modules defaults, so I set about trying to work with ‘transpileDependencies’ settings, which didn’t work. I tried eliminating dependencies, to explicitly set the dependency file path, all with no success, until I went back to testing with the ‘hello-world’ app.
The effect in a ‘real-world’ project is unpredictable but consistent in that it does happen every time. If I remove a dependency, then which dependency is rewritten changes - generally between one and two, although it does seem to like rewriting Bootstrap when available. After a couple of days at this I realised that it was the runtimeCompiler setting that was triggering it.
I don’t explicitly need the runtimeCompiler, I’m not sure why I enabled this, but it seems to me that this is a bug and I have seen that others have encountered this also.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (2 by maintainers)
Top GitHub Comments
Do you have an actual reproduction repo? Because I can’t find any arrow functions after following your steps to reproduce.
Hey again! 😸️
It’s been 20 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it. Please keep in mind that I’m only a robot, so if I’ve closed this issue in error, I’m
HUMAN_EMOTION_SORRY
. 🤖 Please feel free to reopen this issue or create a new one if you need anything else.Thanks again for being part of the Vue community! 💚️