swc-project / swc-loader

Moved to https://github.com/swc-project/pkgs
MIT License
394 stars 29 forks source link

Do swc-loader not support sourcemap #14

Closed ws456999 closed 4 years ago

ws456999 commented 4 years ago

Do swc-loader not support sourcemap? i Couldn't find any docs of it in the repo.

Would really appreciate an example of enabling full sourcemaps in Webpack.

The following is my configuration.

Thank you!

webpack.js

{
        test: /\.tsx?$/,
        exclude: /node_modules/,
        loader: 'swc-loader',
        options: {
           sourceMap: true,
        }
}

.swcrc

{
  "jsc": {
    "parser": {
      "syntax": "typescript",
      "tsx": true,
      "decorators": true,
      "dynamicImport": true
    },
    "target": "es2016"
  }
}
kdy1 commented 4 years ago

I modified the example to generate a source map.

https://github.com/swc-project/swc-loader/blob/87c3fe6659c4a8b1d27116239a11e8429ad76c96/example/webpack.config.js#L4-L24