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

tsup-node should not mark module alias as external #409

Closed
egoist opened this issue Sep 16, 2021 · 5 comments
Closed

tsup-node should not mark module alias as external #409

egoist opened this issue Sep 16, 2021 · 5 comments
Labels
bug Something isn't working released

Comments

@egoist
Copy link
Owner

egoist commented Sep 16, 2021

If you have a path alias like @app/* configured in tsconfig.json and run tsup-node against your files, @app will be accidentally marked as external, it needs to be fixed here:

if (skipNodeModulesBundle) {
build.onResolve({ filter: NON_NODE_MODULE_RE }, (args) => ({
path: args.path,
external: true,
}))
}

@egoist egoist added the bug Something isn't working label Sep 16, 2021
@egoist
Copy link
Owner Author

egoist commented Sep 16, 2021

Fow now just use the command tsup instead.

@br0p0p
Copy link

br0p0p commented Nov 23, 2021

Hi, I'm using Yarn's link: protocol for aliasing and tsup is marking the alias as an external.

for example in my package.json I have:

"dependencies": {
	"~src": "link:./src"
}

and ~src is being marked as external in the build config.

The solution is probably to either handle this case specifically by filtering out dependencies that use the link: protocol from the external list or remove aliases determined from tsconfig's paths from the external list.

@egoist
Copy link
Owner Author

egoist commented Nov 23, 2021 via email

@br0p0p
Copy link

br0p0p commented Nov 23, 2021

@egoist I'm already using tsup (not tsup-node) but I'll move the alias to devDependencies 👍

@egoist egoist closed this as completed in 8eac146 Nov 25, 2021
@github-actions
Copy link

🎉 This issue has been resolved in version 5.9.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

No branches or pull requests

2 participants