Skip to content

why not pass the transform sourcemap to webpack  #154

Description

@luhc228

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions