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
{{ message }}
Repository navigation
why not pass the transform sourcemap to webpack #154
Hi~ I'm now using unplugin to write a plugin and the plugin will be transformed to webpack plugin and esbuild plugin.
I only use one plugin to transform the .jsx file. In other words, there is only one loader to handle .jsx file. So the transform function's param, map is undefined. But after I transform the .jsx file, I get the res.map value which is not the undefined. I am confused why the unplugin use the map first but not the res.map?
Activity
antfu commentedon Aug 15, 2022
If there was no map from the beginning and we provide a map, it will cause Webpack to throw an error on merging the sourcemap with null
luhc228 commentedon Aug 15, 2022
I make a change like these in
node_modules/unplugin/dist/webpack/transform.js, it works. So will the unplugin makes a change? @antfuantfu commentedon Aug 29, 2022
I would need a reproduction to confirm this is a valid fix.
luhc228 commentedon Aug 30, 2022
@antfu Thank you for your replying.
Here is my demo which can reproduct the problem.
You can install the dependencies and the run the script
npm startto start the dev server.Well, u can see this line. I console the transform result and the sourcemap is correct.
But the final sourcemap is incorrect.
antfu commentedon Oct 26, 2026
This is a duplicate of #616. That issue has a fix in #615, so please follow it there. Tell us if yours is different and we will reopen.
🤖 Automated by an agent.