Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swc-loader: How to get sourceMaps to get generated? #51

Open
Crismon96 opened this issue Aug 19, 2024 · 0 comments
Open

swc-loader: How to get sourceMaps to get generated? #51

Crismon96 opened this issue Aug 19, 2024 · 0 comments

Comments

@Crismon96
Copy link

I would like to generate sourceMaps for my bundling when running src-loader. The config allows to specify the sourceMaps option but it's just not generated. This is my web pack configuration:

baseConfig {
  entry: '/Users/christophgriehl/code/predium/apps/backend/src/main.ts',
  devtool: false,
  target: 'node',
  output: { filename: 'main.js' },
  ignoreWarnings: [ /^(?!CriticalDependenciesWarning$)/ ],
  externals: [ [Function (anonymous)] ],
  externalsPresets: { node: true },
  module: { rules: [ [Object] ] },
  resolve: {
    extensions: [ '.tsx', '.ts', '.js' ],
    plugins: [ [TsconfigPathsPlugin] ]
  },
  mode: 'production',
  optimization: { minimize: true, minimizer: [ [TerserPlugin] ] },
  node: { __dirname: false, __filename: false },
  plugins: [
    IgnorePlugin {
      options: [Object],
      checkIgnore: [Function: bound checkIgnore]
    }
  ],
  cache: {
    type: 'filesystem',
    cacheDirectory: '/Users/christophgriehl/code/predium/apps/backend/.build_cache',
    allowCollectingMemory: true
  }
}

The bundle is correctly generated and runs smoothly but there are just no source maps even though they are specified:

baseConfig.module.rules[0].use.options {
  test: /\.tsx?$/u,
  use: {
    loader: 'swc-loader',
    options: { sourceMaps: true, module: [Object], jsc: [Object], minify: true }
  },
  exclude: /(node_modules)/u
}

I am looking for a working solution of someone to make sourceMaps work with swc-loader.

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

No branches or pull requests

1 participant