Skip to content

Commit

Permalink
cli: fix for node_modules inside local packages being transformed
Browse files Browse the repository at this point in the history
  • Loading branch information
Rugvip committed Dec 7, 2020
1 parent a1fffce commit 0117081
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/fast-frogs-wave.md
Original file line number Diff line number Diff line change
@@ -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.
7 changes: 6 additions & 1 deletion packages/cli/src/lib/bundler/transforms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down

0 comments on commit 0117081

Please sign in to comment.