Allow tree-shaking of frontend plugins
Adding rollup's preserveModules to enable tree-shaking in webpack. Signed-off-by: Tomasz Szuba <tszuba@box.com>
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
|
||||
@@ -100,6 +100,7 @@ export async function makeRollupConfigs(
|
||||
chunkFileNames: `esm/[name]-[hash].esm.js`,
|
||||
format: 'module',
|
||||
sourcemap: true,
|
||||
preserveModules: true,
|
||||
});
|
||||
// Assume we're building for the browser if ESM output is included
|
||||
mainFields.unshift('browser');
|
||||
|
||||
Reference in New Issue
Block a user