cli: use preserveModules for CJS builds
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/cli': patch
|
||||
---
|
||||
|
||||
Preserve directory structure for CommonJS build output, just like ESM. This makes the build output more stable and easier to browse, and allows for more effective tree shaking and lazy imports.
|
||||
@@ -123,6 +123,8 @@ export async function makeRollupConfigs(
|
||||
format: 'commonjs',
|
||||
interop: 'compat',
|
||||
sourcemap: true,
|
||||
preserveModules: true,
|
||||
preserveModulesRoot: `${targetDir}/src`,
|
||||
exports: 'named',
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user