-
Notifications
You must be signed in to change notification settings - Fork 915
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
comments not removed #2076
Comments
I created an example project https://github.com/Coding-Kiwi/vue-comments This is the comment https://github.com/Coding-Kiwi/vue-comments/blob/master/App.vue#L5 And in the build at the end you can see https://github.com/Coding-Kiwi/vue-comments/blob/master/dist/main.78f2c16d3e664b627fa4.js |
Okay after adding
to the loader config it removes the comments.. The vue docs say the default is false, but only for the runtime-build which is not the case when using vue-loader The vue-loader docs say the default compilerOptions is empty and to look at the vue-template-compiler docs And there... the comments option is not even listed. |
I came across the very same odd behaviour while analysing one of our builds. I've traced this to the Vue.js 'use strict'
if (process.env.NODE_ENV === 'production') {
module.exports = require('./dist/compiler-core.cjs.prod.js')
} else {
module.exports = require('./dist/compiler-core.cjs.js')
} So, depending on Looking further into the default
is statically set to either Importing As you discovered, one solution is to explicitly set But I fully agree, if the Vue.js documentation says the default is |
I have a component with a comment
I use webpack to bundle my app
The "test 123" gets removed but the "this is a test" in the html is not removed and becomes part of the minifed bundle. Here you can see an example:
I use vue 3.4.27 and vue-loader 17.4.2
I do not have specified
app.config.compilerOptions.comments
What am I missing?
The text was updated successfully, but these errors were encountered: