Plugin resolver: Forbids resolving #
- because of subpathImports?
#19536
Replies: 3 comments
-
I understand by the way that the code that actually handles this is rollup-plugin-alias, but I cannot find anything they do to prevent handling "#" |
Beta Was this translation helpful? Give feedback.
-
I'm not sure if this is necessary intended or if there's any blocker. Please feel free to create an issue. It's possible that this is sass/scss specific thing (which is known to have certain limitation in custom resolver such as #19042), so it would be nice to know if other files (js, css, ...) have the same issue. |
Beta Was this translation helpful? Give feedback.
-
For future readers: I opened an issue here #19560 (comment), and it seems to be a known issue with the sass modern API. Closing this. |
Beta Was this translation helpful? Give feedback.
-
Hey! I'm switching a monorepo to use nodejs subpath imports (prefixed with
#
) instead of tsconfig paths.Now, I want to use the
#
for import paths in scss files as well. The plan was to use vite's resolver plugin alias like we did before (we used the$
before, and it worked great).It seems like vite doesn't support this? Looking at the sourcecode, it looks like vite is just not resolving anything that starts with a
#
. There is one comment mentioningWe don't support '#' in user source code
. So is there no way to resolve paths like this?See https://stackblitz.com/edit/vitejs-vite-suxihvhf?file=vite.config.ts for an example.
pnpm dev
runs it with debug mode, so you can see thatvite:resolve
isn't doing anything for those imports.Beta Was this translation helpful? Give feedback.
All reactions