Merge pull request #23417 from szubster/tree-shaking
Allow tree-shaking of frontend plugins
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/cli': patch
|
||||
---
|
||||
|
||||
Add preserveModules to rollup, which allows better async loading and tree-shaking in webpack
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user