Skip to content

Commit

Permalink
docs: Improve monorepo configuration example
Browse files Browse the repository at this point in the history
  • Loading branch information
ntucker committed Apr 21, 2022
1 parent 0c51250 commit 3f27ae3
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions packages/webpack-config-anansi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -381,11 +381,22 @@ regexes.
libraryExclude defaults to `/node_modules/`, which will exclude libraries from expensive
and potentially incorrect processing from babel loaders.

To match all libraries in namespace `@myspacespace`:
With a monorepo layout like so

```
/
/packages
/package-a
/package-b
/myapp
webpack.config.js
```

Where `package-a` and `package-b` are namespaced under `@myspacespace`:

```js
const myConfig = makeConfig({
libraryInclude: /node_modules\/(@mynamespace\/)/,
libraryInclude: path.resolve(__dirname, '../packages'),
libraryExclude: /node_modules(?!\/(@mynamespace\/))/,
});
```
Expand Down

0 comments on commit 3f27ae3

Please sign in to comment.