Skip to content

devtool: 'eval-nosources-*' still contains sourcesContent #16318

@ahabhgk

Description

@ahabhgk

Bug report

What is the current behavior?

The source map string converted by the base64 output of devtool: 'eval-nosources-source-map' still contains the sourcesContent field.

If the current behavior is a bug, please provide the steps to reproduce.

Here is a minimal reproduce:

module.exports = {
  entry: './src/index.js',
  output: {
    filename: 'main.js',
    path: path.resolve(__dirname, 'dist'),
  },
  mode: 'development',
  devtool: 'eval-nosources-source-map', // <----- here
};
const output = /* copy the base64 of source map from dist */
console.log(Buffer.from(output, 'base64').toString('utf-8')) // still contains the `sourcesContent` field

What is the expected behavior?

Don't contains the sourcesContent field since the nosources is used.

Other relevant information:
webpack version: 5.74.0
Node.js version: 16
Operating System: -
Additional tools: -

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions