Skip to content

Commit 79f83dc

Browse files
committed
build: update vue-router.esm-browser.prod.js
1 parent 4bf7c89 commit 79f83dc

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

packages/router/rollup.config.mjs

+6-7
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,7 @@ const packageConfigs = packageBuilds.map(buildName =>
5959
packageBuilds.forEach(buildName => {
6060
if (buildName === 'cjs') {
6161
packageConfigs.push(createProductionConfig(buildName))
62-
return;
63-
}
64-
65-
if (['global', 'browser'].includes(buildName)) {
62+
} else if (buildName === 'global' || buildName === 'browser') {
6663
packageConfigs.push(createMinifiedConfig(buildName))
6764
}
6865
})
@@ -128,6 +125,10 @@ function createConfig(buildName, output, plugins = []) {
128125
// Global and Browser ESM builds inlines everything so that they can be
129126
// used alone.
130127
external,
128+
treeshake: {
129+
// Ensure @vue/devtools-api can be treeshaken in production builds
130+
moduleSideEffects: false,
131+
},
131132
plugins: [
132133
tsPlugin,
133134
createReplacePlugin(
@@ -224,12 +225,10 @@ function createProductionConfig(format) {
224225
}
225226

226227
function createMinifiedConfig(format) {
227-
const item = path.parse(outputConfigs[format].file);
228-
229228
return createConfig(
230229
format,
231230
{
232-
file: `${item.dir}/${item.name}.prod${item.ext}`,
231+
file: outputConfigs[format].file.replace(/.js$/, '.prod.js'),
233232
format: outputConfigs[format].format,
234233
},
235234
[

0 commit comments

Comments
 (0)