-
Notifications
You must be signed in to change notification settings - Fork 11
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 Request] Import map support #71
Comments
Hey! Can you elaborate on you ideas? 🤔 |
I would like to dynamically import specific chunks via import maps The code would look like export function importCustomModule(moduleName: string) {
return import(moduleName)
} Which avoids the drawback of dynamic imports not having deep variable imports or having to specify the extension |
The If you want to import modules as you please, there is a way to do it. export function importCustomModule(moduleName: string) {
- return import(moduleName)
+ return import(`@/${moduleName}`)
} Configuration the // vite.config.ts
export {
resolve: {
// The vite-plugin-dinamic-import will automatically calculate the relative path.
alias: { '@': __dirname },
},
} I'm not sure if this will make you feel embarrassed, if that's the case. // vite.config.ts
export defalut {
plugins: [
dynamicImport({
onResolve(rawImportee) {
return contextPath + rawImportee;
},
}),
],
} |
https://github.com/WICG/import-maps The |
Perhaps, we need an new plugin for import map. |
Hey there, I am curious to know if it is possible to add import map support.
Thanks.
The text was updated successfully, but these errors were encountered: