-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
feat: allow components to provide absolute import path #234
base: main
Are you sure you want to change the base?
Conversation
I think it should still work by setting a relative path to node_modules. Are you using a virtual import pattern? An example would be nice :) |
templates/components/index.js
Outdated
@@ -4,13 +4,14 @@ | |||
c.prefetch === true || typeof c.prefetch === 'number' ? `webpackPrefetch: ${c.prefetch}` : false, | |||
c.preload === true || typeof c.preload === 'number' ? `webpackPreload: ${c.preload}` : false, | |||
].filter(Boolean).join(', ') | |||
const filePath = c.isAbsolute ? c.filePath : `../${relativeToBuild(c.filePath)}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We would need to normalize windows paths in fullPath condition
The import for See unplugin/unplugin-icons#63 for the implementation. This other case I can think about might be importing from some libraries, like: As for the windows path resolution, I guess since the |
I'm mostly hesitating to see if we really need another component option or can actually fix the situation by default. For resolving
This case makes sense. But maybe with a flag like One more point, we usually allow inherit options from |
Do you mean we rename |
Yes please, and also auto-enable the flag when |
08a7a77
to
44abecd
Compare
Sorry guys I don't want to disturb you here but I guess this is stale for a long time. Will this get updated? Actually, I am waiting for this PR unplugin/unplugin-icons#63 Regards. |
Still waiting too. |
This would allow libraries to provide absolute import paths (from library submodules, or virtual modules) using the
components:extend
hook. In my case, I am integrating withunplugin-icons
.