8000 docs: add documentation for exclude patterns (#2132) · aspect-build/rules_js@fbb2456 · GitHub
[go: up one dir, main page]

Skip to content

Commit fbb2456

Browse files
authored
docs: add documentation for exclude patterns (#2132)
1 parent adafa56 commit fbb2456

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

docs/troubleshooting.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,27 @@ This can lead to builds performing slower due to IO throttling, or even failing
162162

163163
If you are experiencing slower than expected builds, you can try disabling or reducing parallelism for the tools you are using.
164164

165+
### Unnecessary npm package content
166+
167+
Npm packages sometimes include unnecessary files such as tests, test data etc. Large files or a large number of files
168+
can effect performance and are sometimes worth explicitly excluding content.
169+
170+
In these cases you can add such packages and the respective files/folders you want to exclude to your npm_translate_lock
171+
rule in the `exclude_package_contents` attribute like so:
172+
173+
```starlark
174+
npm.npm_translate_lock(
175+
...
176+
exclude_package_contents = {
177+
"resolve": ["**/test/*"],
178+
},
179+
)
180+
```
181+
182+
This example will remove the test folder.
183+
184+
You can use this to remove whatever you find to be not needed for your project.
185+
165186
#### Jest
166187

167188
See [rules_jest](https://github.com/aspect-build/rules_jest) specific [troubleshooting](https://docs.aspect.build/rulesets/aspect_rules_jest/docs/troubleshooting#performance).

0 commit comments

Comments
 (0)
0