-
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
Path of Vue component file is exposed by __vue_options__.__file
.
#516
Comments
This is disabled in production and is used in development to provide better error messages. |
Excuse me, how to turn that |
Just minimize your code, e.g. with uglify webpack plugin. We already do or in our template. |
I'm sorry for bumping this old issue, but is there any reason why even production builds now expose component's filename? Maybe there should be a way to disable this behavior? |
See: Lines 178 to 186 in f0beed3
|
I've seen this code multiple times. I just want to have a way to disable this behaviour since I don't rely on devtools and runtime warnings in production 😞 Maybe I shouldn't have migrated to Webpack 4.. |
you can always
If you actually want to make an effort to have this changed in vue-loader itself, please open a feature request with an explanation about why this is a problem for you and why offering a way to remove it is valuable to you, and if you want to help us even more, send a PR. Debates in months-old, closed issues easily get lost. |
I have created #1446 to document the behavior. |
For those who inspected their minified bundles and were most surprised by this undocumented sensitive information leak, here is how to fix it if you use
And in your webpack config: module: {
rules: [
{
test: /\.vue$/,
use: [
{
loader: 'string-replace-loader',
options: {
search: '\\.options\\.__file = ".*"',
replace: '.options.__file = "a.vue"',
flags: '',
},
},
{ loader: 'vue-loader' },
],
},
],
}, Of course, it's relatively fragile, so check periodically that it's still working. |
I use vue-loader@^9.
How to avoid this?
The text was updated successfully, but these errors were encountered: