-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
jspm:import-mapping plugin never trigger #7
Comments
Hello, can you try the latest |
seeing the same issue too after bundling. After running
|
I found out that in my case this only happens when the dependency in package.json. when it's there, this plugin doesn't generate a import map and vite bundles the app by taking the dependency from node_modules. as soon as I remove it, it works. is there any way to make the plugin force generate an import map even if the dependency is there in package.json ? or some form of include/exclude list ? |
Looks like vite might be resolving the deps from the |
I don't have much idea about vite plugins, but I think plugin ordering can help https://github.com/jspm/vite-plugin-jspm/blob/main/plugin/src/index.ts#L180 https://vitejs.dev/guide/using-plugins.html#enforcing-plugin-ordering I've started a thread in vite help channel of discord and linked this issue. https://discord.com/channels/804011606160703521/1174703054101168219/1174703054101168219 if you're there on discord please check it out. thank you for initiative |
I think we can do something like this, I'll try to make it work this weekend https://github.com/MilanKovacic/vite-plugin-externalize-dependencies/blob/main/src/index.ts |
Hi @soulsam480 thanks for the follow-up on this. Highly appreciate it 😄 |
hey @JayaKrishnaNamburu , I made it work without the downloadDeps option soulsam480@71023ee#diff-8a5fbf50d373626ae826a0917ccac02a9a838e8dc7dc7f4cc34ea2fc00402219. I don't fully understand how downloadDeps is handled. if you can kindly point me to a doc explaining how the plugin is architected currently that'd be a great help. Also the reason why it didn't work earlier is the deps were marked external in the |
Hi @soulsam480 thanks for looking into this again. We can actually re-write the whole plugin. I was actually hopping to do it once. Here is a very simple implementation for the same with a rollup-plugin The |
Seems that the
resolveId
hook fo thejspm:import-mapping
plugin never triggers.I've
npm create vite@latest my-vue-app -- --template vue
and added the jspm plugin in my vite config asThe import map is correctly generated and written in the index.html, but the the output js of the build seems to contain all the modules and when I serve the build directory the browser is not fetching anything from anywhere except the bundle's index.js from the localhost and the es-module-shims.js from ga.jspm.io.
In my package.json i have those deps
Am I missing some piece of configuration or something trivial?
The text was updated successfully, but these errors were encountered: