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

support NODE_PATH / nodePaths #55

Closed
Tracked by #12
threepointone opened this issue Nov 29, 2021 · 3 comments
Closed
Tracked by #12

support NODE_PATH / nodePaths #55

threepointone opened this issue Nov 29, 2021 · 3 comments

Comments

@threepointone
Copy link
Contributor

Not all modules will be under node_modules, especially in scenaros where folks vendor modules into their own repo. We should support passing NODE_PATH as an env var or nodePaths as config.

@threepointone threepointone mentioned this issue Dec 21, 2021
27 tasks
@petebacondarwin petebacondarwin added this to the Wrangler 2.0 milestone Feb 1, 2022
@petebacondarwin
Copy link
Contributor

The Node.js docs suggest that NODE_PATH is legacy and not really how things should be done.

Given that we are able to compile TypeScript, it would also be necessary to add to the "paths" mapping property in tsconfig.json so that TSC can also find the dependencies.
So I think the best way to solve this would be to implement (either ourselves or using a library) an esbuild plugin that does something like: https://www.npmjs.com/package/@esbuild-plugins/tsconfig-paths

@threepointone
Copy link
Contributor Author

I checked, and esbuild reads from compilerOptions.paths already, so the plug-in shouldn't be necessary

I agree with you original point. Could just close this for now, or revisit in 2.1

@petebacondarwin
Copy link
Contributor

Let's close this and reopen if someone finds a scenario we don't support out-of-the-box.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants