Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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! 🤝


const c = {
external: ['vue'],
Expand Down Expand Up @@ -61,7 +62,9 @@ function createEntry(config) {
__DEV__: isBundlerBuild
? `(process.env.NODE_ENV !== 'production')`
: config.env !== 'production',
__VUE_PROD_DEVTOOLS__: isBundlerBuild ? '__VUE_PROD_DEVTOOLS__' : 'false'
__VUE_PROD_DEVTOOLS__: isBundlerESMBuild
? '__VUE_PROD_DEVTOOLS__'
: 'false'
}))

if (config.transpile !== false) {
Expand Down