You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ok I'm understanding now. The variable naming was a bit confusing. The name of the plugin in that configuration is unplugin-starter, so that's likely your issue. You should be doing this in your Webpack config:
Yeah, this is my current configuration, but the resolveId function doesn't work in webpack project as expected, and it throw an error which indicates the virtual module is not found.
Activity
tropicalraisel commentedon Sep 12, 2021
When importing, you need to do something like
my-unplugin-virtual-id/{framework}, whereframeworkis eitherwebpack,rollup, orvite.Just out of curiosity, why are you using the
loadstatement like that? It seems unnecessary.Codpoe commentedon Sep 13, 2021
Sorry, I don't understand what you mean. I think my plugin has been set up correctly:
I’m just giving a simplest example.😂
tropicalraisel commentedon Sep 13, 2021
I'm saying that your "import str" statement is strange b/c:
webpack.config.js.Codpoe commentedon Sep 13, 2021
my-pluginmy-unplugin-virtual-idis the virtual module which is expected to be resolved inresolveIdfunction.import str from 'my-unplugin-virtual-id'is in the business code , not my configuration.tropicalraisel commentedon Sep 13, 2021
Ok I'm understanding now. The variable naming was a bit confusing. The name of the plugin in that configuration is
unplugin-starter, so that's likely your issue. You should be doing this in your Webpack config:Codpoe commentedon Sep 13, 2021
Yeah, this is my current configuration, but the
resolveIdfunction doesn't work in webpack project as expected, and it throw an error which indicates the virtual module is not found.tropicalraisel commentedon Sep 13, 2021
Try deleting your
loadsection and see if it works then. My suspicion is this error is thrown there and not inresolveId.Codpoe commentedon Sep 18, 2021
I tried to do what you said, but it still didn’t work
danielroe commentedon Oct 21, 2022
I'm getting this as well. In case it's helpful, here are three reproductions:
yunsii commentedon Jul 24, 2023
Unplugin
resolveIdwith virtual modules seem still not work in webpack on Windows OS.yunsii commentedon Jul 25, 2023
It works today, but i don't konw what happens 😦