Skip to content

Commit

Permalink
build: update vue-router.esm-browser.prod.js
Browse files Browse the repository at this point in the history
  • Loading branch information
skirtles-code committed May 17, 2024
1 parent 4bf7c89 commit 79f83dc
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions packages/router/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,7 @@ const packageConfigs = packageBuilds.map(buildName =>
packageBuilds.forEach(buildName => {
if (buildName === 'cjs') {
packageConfigs.push(createProductionConfig(buildName))
return;
}

if (['global', 'browser'].includes(buildName)) {
} else if (buildName === 'global' || buildName === 'browser') {
packageConfigs.push(createMinifiedConfig(buildName))
}
})
Expand Down Expand Up @@ -128,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,12 +225,10 @@ function createProductionConfig(format) {
}

function createMinifiedConfig(format) {
const item = path.parse(outputConfigs[format].file);

return createConfig(
format,
{
file: `${item.dir}/${item.name}.prod${item.ext}`,
file: outputConfigs[format].file.replace(/.js$/, '.prod.js'),
format: outputConfigs[format].format,
},
[
Expand Down

0 comments on commit 79f83dc

Please sign in to comment.