Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: respect noExternal option with Tsup node #720

Merged
merged 4 commits into from Oct 17, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/README.md
Expand Up @@ -64,7 +64,8 @@ tsup automatically excludes packages specified in the `dependencies` and `peerDe
tsup-node src/index.ts
```

All other CLI flags still apply to this command.
All other CLI flags still apply to this command. You can still use the `noExternal` option to reinclude packages in the bundle,
for example packages that belong to a local monorepository.

**If the regular `tsup` command doesn't work for you, please submit an issue with a link to your repo so we can make the default command better.**

Expand Down
3 changes: 3 additions & 0 deletions src/esbuild/external.ts
Expand Up @@ -28,6 +28,9 @@ export const externalPlugin = ({
if (match(args.path, resolvePatterns)) {
return
}
if (match(args.path, noExternal)) {
eric-burel marked this conversation as resolved.
Show resolved Hide resolved
return
}
if (NON_NODE_MODULE_RE.test(args.path)) {
return {
path: args.path,
Expand Down
1 change: 1 addition & 0 deletions src/options.ts
Expand Up @@ -116,6 +116,7 @@ export type Options = {
silent?: boolean
/**
* Skip node_modules bundling
* Will still bundle modules matching the `noExternal` option
*/
skipNodeModulesBundle?: boolean
/**
Expand Down