From: skirtle <65301168+skirtles-code@users.noreply.github.com> Date: Wed, 13 Nov 2024 11:10:52 +0000 (+0000) Subject: build: add vue-router.esm-browser.prod.js (#2242) X-Git-Tag: v4.5.0~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=846e287b68b41b2014b7b24060f3873fe2539658;p=thirdparty%2Fvuejs%2Frouter.git build: add vue-router.esm-browser.prod.js (#2242) Co-authored-by: kianfang Co-authored-by: Kian <16569491+kianfang@users.noreply.github.com> --- diff --git a/packages/router/rollup.config.mjs b/packages/router/rollup.config.mjs index d82c4795..fc8aaa3b 100644 --- a/packages/router/rollup.config.mjs +++ b/packages/router/rollup.config.mjs @@ -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)) } }) @@ -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( @@ -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, }, [