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

build: add vue-router.esm-browser.prod.js #2242

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from all 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
8 changes: 6 additions & 2 deletions packages/router/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const packageConfigs = packageBuilds.map(buildName =>
packageBuilds.forEach(buildName => {
if (buildName === 'cjs') {
packageConfigs.push(createProductionConfig(buildName))
} else if (buildName === 'global') {
} else if (buildName === 'global' || buildName === 'browser') {
packageConfigs.push(createMinifiedConfig(buildName))
}
})
Expand Down Expand Up @@ -125,6 +125,10 @@ function createConfig(buildName, output, plugins = []) {
// Global and Browser ESM builds inlines everything so that they can be
// used alone.
external,
treeshake: {
// Ensure @vue/devtools-api can be treeshaken in production builds
moduleSideEffects: false,
},
plugins: [
tsPlugin,
createReplacePlugin(
Expand Down Expand Up @@ -224,7 +228,7 @@ function createMinifiedConfig(format) {
return createConfig(
format,
{
file: `dist/${name}.${format}.prod.js`,
file: outputConfigs[format].file.replace(/.js$/, '.prod.js'),
format: outputConfigs[format].format,
},
[
Expand Down
Loading