Skip to content

Commit 846e287

Browse files
build: add vue-router.esm-browser.prod.js (#2242)
Co-authored-by: kianfang <[email protected]> Co-authored-by: Kian <[email protected]>
1 parent 8c73877 commit 846e287

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Diff for: packages/router/rollup.config.mjs

+6-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ const packageConfigs = packageBuilds.map(buildName =>
5959
packageBuilds.forEach(buildName => {
6060
if (buildName === 'cjs') {
6161
packageConfigs.push(createProductionConfig(buildName))
62-
} else if (buildName === 'global') {
62+
} else if (buildName === 'global' || buildName === 'browser') {
6363
packageConfigs.push(createMinifiedConfig(buildName))
6464
}
6565
})
@@ -125,6 +125,10 @@ function createConfig(buildName, output, plugins = []) {
125125
// Global and Browser ESM builds inlines everything so that they can be
126126
// used alone.
127127
external,
128+
treeshake: {
129+
// Ensure @vue/devtools-api can be treeshaken in production builds
130+
moduleSideEffects: false,
131+
},
128132
plugins: [
129133
tsPlugin,
130134
createReplacePlugin(
@@ -224,7 +228,7 @@ function createMinifiedConfig(format) {
224228
return createConfig(
225229
format,
226230
{
227-
file: `dist/${name}.${format}.prod.js`,
231+
file: outputConfigs[format].file.replace(/.js$/, '.prod.js'),
228232
format: outputConfigs[format].format,
229233
},
230234
[

0 commit comments

Comments
 (0)