Skip to content

Commit

Permalink
build: add vue-router.esm-browser.prod.js (#2242)
Browse files Browse the repository at this point in the history
Co-authored-by: kianfang <kianfang@163.com>
Co-authored-by: Kian <16569491+kianfang@users.noreply.github.com>
  • Loading branch information
3 people authored Nov 13, 2024
1 parent 8c73877 commit 846e287
Showing 1 changed file with 6 additions and 2 deletions.
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

0 comments on commit 846e287

Please sign in to comment.