-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
fix(devtools): fix __VUE_PROD_DEVTOOLS__ defined in cjs build (#1991) #1992
Conversation
@cokemine Thanks for the PR! I've pushed the change. We only need to enable Just in case, could you try the build and make sure it's fixed at your env? |
rollup.config.js
Outdated
@@ -27,6 +27,7 @@ function createEntries() { | |||
function createEntry(config) { | |||
const isGlobalBuild = config.format === 'iife' | |||
const isBundlerBuild = config.format !== 'iife' && !config.browser | |||
const isBundlerESMBuild = /esm-bundler/.test(format) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if it should be const isBundlerESMBuild = config.format === 'es'
otherwise I cannot build and told me format is not defined
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh damn sorry, it should be config.format
😓 Fixed!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But why it can pass unit test🤔, and I think isBundlerESMBuild will always be false
, because no config.format
can pass the regex
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah because I think I'm drunk or something... it should be config.file
... 🤮
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's finally fixed...!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohh, it's same. But I know what you mean, and I think it's better to be const isBundlerESMBuild = config.format === 'es'
, which is consistent in format
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK good point. Just updated to not include esm-browser
builds.
const isBundlerESMBuild = config.format === 'es' && !config.browser
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! I think it's finished now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙌 🙌 🙌 🙌 🙌
Thank you so much for your patients! 🤝
Yeah, I 've tested in my reproduce repo. I think it is corrent now. |
fix #1991
I don't know if I changed it right
But I think VUE_PROD_DEVTOOLS should be replaced to 'false' in the cjs mode.
There should be some small errors here.