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?
|
callback(null, res.code, map == null ? map : (res.map || map)) |
Here is how I use the unplugin transform hook:
https://github.com/ice-lab/ice-next/blob/f5755a0c0afdda87b97393ce6dc44f0ac9b4db84/packages/webpack-config/src/unPlugins/compilation.ts#L104
webpack loader load order: https://webpack.js.org/contribute/writing-a-loader/#complex-usage
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
.jsxfile. In other words, there is only one loader to handle.jsxfile. So the transform function's param,mapisundefined. But after I transform the.jsxfile, I get theres.mapvalue which is not theundefined. I am confused why the unplugin use themapfirst but not theres.map?unplugin/src/webpack/loaders/transform.ts
Line 31 in f647af7
Here is how I use the unplugin transform hook:
https://github.com/ice-lab/ice-next/blob/f5755a0c0afdda87b97393ce6dc44f0ac9b4db84/packages/webpack-config/src/unPlugins/compilation.ts#L104
webpack loader load order: https://webpack.js.org/contribute/writing-a-loader/#complex-usage