Skip to content
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

Merged
merged 6 commits into from Jun 1, 2021

Conversation

cokemine
Copy link
Contributor

@cokemine cokemine commented Jun 1, 2021

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.

@kiaking kiaking added 4.x bug Something isn't working labels Jun 1, 2021
@kiaking
Copy link
Member

kiaking commented Jun 1, 2021

@cokemine Thanks for the PR! I've pushed the change. We only need to enable __VUE_PROD_DEVTOOLS__ in esm-bundler build so I've changed it to reflect that.

Just in case, could you try the build and make sure it's fixed at your env?

@kiaking kiaking changed the title fix: fix __VUE_PROD_DEVTOOLS__ defined in cjs fix(devtools): fix __VUE_PROD_DEVTOOLS__ defined in cjs build (#1991) Jun 1, 2021
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)
Copy link
Contributor Author

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

Copy link
Member

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!

Copy link
Contributor Author

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

Copy link
Member

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... 🤮

Copy link
Member

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...!

Copy link
Contributor Author

@cokemine cokemine Jun 1, 2021

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

Copy link
Member

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

Copy link
Contributor Author

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.

Copy link
Member

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! 🤝

@cokemine
Copy link
Contributor Author

cokemine commented Jun 1, 2021

Yeah, I 've tested in my reproduce repo. I think it is corrent now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants