Merge pull request #27003 from backstage/rugvip/preserve

cli: use preserveModules for CJS builds
This commit is contained in:
Patrik Oldsberg
2024-10-07 18:50:51 +02:00
committed by GitHub
2 changed files with 7 additions and 0 deletions
+5
View File
@@ -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.
+2
View File
@@ -123,6 +123,8 @@ export async function makeRollupConfigs(
format: 'commonjs',
interop: 'compat',
sourcemap: true,
preserveModules: true,
preserveModulesRoot: `${targetDir}/src`,
exports: 'named',
});
}