Merge pull request #23417 from szubster/tree-shaking

Allow tree-shaking of frontend plugins
This commit is contained in:
Patrik Oldsberg
2024-04-18 17:18:29 +02:00
committed by GitHub
2 changed files with 7 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/cli': patch
---
Add preserveModules to rollup, which allows better async loading and tree-shaking in webpack
+2
View File
@@ -105,6 +105,8 @@ export async function makeRollupConfigs(
chunkFileNames: `esm/[name]-[hash].esm.js`,
format: 'module',
sourcemap: true,
preserveModules: true,
preserveModulesRoot: `${targetDir}/src`,
});
// Assume we're building for the browser if ESM output is included
mainFields.unshift('browser');