-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[Feature]: Custom package path resolver #1405
Comments
This and I could try remix. Monorepo support is essential to me. |
tyrauber
added a commit
to tyrauber/remix-react-native-web-starter
that referenced
this issue
Feb 13, 2022
Instead of using pnpm, alias the module using tsconfig paths. ``` "paths": { "~react-native": ["./node_modules/react-native-web"], "~/*": ["./app/*"], }, ``` Remix currently only accepts paths with prefixes with ~ or ., as mentioned in this [this issues](remix-run/remix#1405), but this has the added benefit of allowing us to import react-native as well, or dependencies that have react-native as a peer dependency.
Closed
2 tasks
machour
added
the
needs-response
We need a response from the original author about this issue/PR
label
Apr 12, 2022
This issue has been automatically closed because we haven't received a response from the original author 🙈. This automation helps keep the issue tracker clean from issues that are unactionable. Please reach out if you have more information for us! 🙂 |
MichaelDeBoey
removed
the
needs-response
We need a response from the original author about this issue/PR
label
Apr 23, 2022
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What is the new or updated feature that you are suggesting?
It would be useful to have support for custom path mappings when importing packages. Currently, you could customize some paths in tsconfig or jsconfig, but there are limitations (see below).
Why should this feature be included?
In most build systems, users have the ability to customize package resolution. For example,
compilerOptions.paths
: https://www.typescriptlang.org/tsconfig#pathsresolveId
: https://rollupjs.org/guide/en/#resolveidIt would be useful for Remix to allow this type of configuration as well, and would give Nx the ability to support lightweight workspace libs for Remix apps.
Current solution and limitations
You can map paths in
tsconfig.json
orjsconfig.json
, however there are some limitations..
or~
as external, so they are not bundled at compile time (https://github.com/remix-run/remix/blob/7d1dda3/packages/remix-dev/compiler.ts#L411-L413).tsconfig.base.json
at the root of the monorepo. This conflicts with Remix's default paths as TS does merge paths.Example
Given a monorepo as follows:
We want to map
@acme/mylib
tolibs/mylib/src/index.ts
so we can import it as such in our app.Alternative solutions
onResolve
callback ([Feature]: Allow custom esbuild-Plugins through remix.config.js #717).The text was updated successfully, but these errors were encountered: