Skip to content

Commit f52946a

Browse files
committed
docs(typescript): note default node_modules exclusion when allowJs expands include
1 parent 3832864 commit f52946a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/typescript/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ Default: `null`
8080
A [picomatch pattern](https://github.com/micromatch/picomatch), or array of patterns, which specifies the files in the build the plugin should operate on. By default all `.ts` and `.tsx` files are targeted. If your `tsconfig.json` (or plugin `compilerOptions`) sets `allowJs: true`, the default include expands to also cover `.js`, `.jsx`, `.mjs`, and `.cjs` files so that JavaScript sources are downleveled by TypeScript as well.
8181

8282
> Note: When `allowJs` is enabled and no `outDir` is configured, this plugin creates a temporary output directory for TypeScript emit to avoid TS5055 (overwriting input files). The effective `outDir` (whether user-provided or the temporary one) is excluded from plugin processing to prevent re-processing emitted files. The temporary directory is removed after a non-watch build completes; in watch mode it is removed when the watcher stops.
83+
>
84+
> When `allowJs` expands the default include and you have not specified patterns via `include`/`exclude`, the plugin also excludes `**/node_modules/**` by default to avoid transforming third-party code.
8385
8486
### `filterRoot`
8587

0 commit comments

Comments
 (0)