-
Notifications
You must be signed in to change notification settings - Fork 74
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
Add support for Node.js Subpath Imports #263
Comments
Can we get an update on this @mrmckeb? |
not working with libraries installed at node_modules too.
|
Hi all, this seems like a fairly simple thing to implement. We should probably look at supporting "exports" too at some stage. Is anyone interested in creating a PR to support this? If not, I can probably make time in the next week or two. |
@Guihgo I think you have a different issue. Can you please raise a new issue with a reproduction? This plugin definitely works with installed packages, and we have tests covering that. |
Hey all! We actually get similar issues here when trying to It seems the resolution system of the plugin doesn't properly use imports/exports resolution (like TS's NodeNext / Bundler |
After digging into this quite a bit, it appears that the issue is not with how I do see in the TS Server log stylesheet-level resolution errors though:
This stylesheet builds fine (OOB Vite / PostCSS / SASS), but the plugin somehow configures either SASS or PostCSS in a way that does not honor ESM I couldn't quite place where in This seems like the same root cause as #275, FWIW At any rate this is a significant source of friction for us, as the rest of the company can't access mixins exposed by our design system now, at least not in a way that doesn't yell at them IDE-wise when this plugin is enabled :( |
Is your feature request related to a problem? Please describe.
I tried using Subpath imports but they don't work. It would be great if it were possible to use native way no configure paths.
Describe the solution you'd like
Subpath imports should work the same way as aliases from
tsconfig.json
work now.Describe alternatives you've considered
I don't know any alternatives for Subpath imports
Additional context
Article: https://betterprogramming.pub/the-native-way-to-configure-path-aliases-in-frontend-projects-5db70f19a6e0
Docs: https://nodejs.org/api/packages.html#subpath-imports
Now the plugin works in two cases:
relative path
import styles from "../styles/Home.module.css";
alias from
tsconfig.json
import styles from "@/styles/Home.module.css";
But if you use subpath imports you get an error:
import styles from "#styles/Home.module.css";
The text was updated successfully, but these errors were encountered: