-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
import devtools from '@vue/devtools' gets into Vite production build #1961
Comments
This rollup plugin can be used as a workaround: {
name: 'vue-devtools-side-effects',
transform(code, id, options?) {
if (/@vue\/devtools\/index.js$/.test(id)) {
return {
code,
moduleSideEffects: false,
map: null,
};
}
},
}, Although you will still get a lot of |
Same here, and the size it adds to the production build is huge! |
It doesn't get into production build but the eval warnings are still there. Can these warnings be fixed? |
Looking for a solution for this as well |
Found it here:
|
Can someone explain why the warnings appear in prod mode ( for what is used eval in this case?) ? |
Version
6.4.3
Browser and OS info
Chrome 105 / macOS 12.6
Steps to reproduce
import devtools from '@vue/devtools'
&@vue/devtools
doesn't get tree shaken and gets into the production build. I have also seen cases of it importing node specific code which leads to an undefined import toemitter
.What is expected?
For it to be tree shaken so it is easy to include
@vue/devtools
standalone only for dev buildsWhat is actually happening?
It is not tree shaken
Without it being tree shaken, I will have to manually comment/uncomment it. I haven't found a way to direct it to tree shake
@vue/devtools
outside of modifying itspackage.json
and adding"sideEffects": false
. It still spews a huge amount ofeval
warnings despite this which I have no idea how to silence.The text was updated successfully, but these errors were encountered: