cli: fix for node_modules inside local packages being transformed

This commit is contained in:
Patrik Oldsberg
2020-12-07 17:29:29 +01:00
parent a1fffce071
commit 0117081027
2 changed files with 11 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/cli': patch
---
Fixes a big in the bundling logic that caused `node_modules` inside local monorepo packages to be transformed.
+6 -1
View File
@@ -35,7 +35,12 @@ export const transforms = (options: TransformOptions): Transforms => {
const extraTransforms = isDev ? ['react-hot-loader'] : [];
const transformExcludeCondition = {
and: [/node_modules/, { not: externalTransforms }],
or: [
// This makes sure we don't transform node_modules inside any of the local monorepo packages
/node_modules.*node_modules/,
// This excludes the local monorepo packages from the excludes, meaning they will be transformed
{ and: [/node_modules/, { not: externalTransforms }] },
],
};
const loaders = [