Skip to content

Prevent sourceMapUrl from appearing on extracted css file #223

@manatarms

Description

@manatarms

I am importing a css file in my app entry.js. I want to prevent the sourceMapUrl from appearing on the extracted css file. I've tried passing sourceMap : false to both css-loader and mini-css-extract-plugin, but it still generates the sourceMappingURL.

Here are the relevant snippets of my config

new MiniCssExtractPlugin({
    filename: isDev
      ? '../static/stylesheets/core.css'
      : '../static/stylesheets/core.[contenthash].css'
})
rules: [
      {
        test: /\.css$/,
        use: [
          {
            loader: MiniCssExtractPlugin.loader,
            options: {
              sourceMap: false
            }
          },
          {
            loader: 'css-loader',
            options: {
              url: false,
              sourceMap: false
            }
       }
]

Expected output:
No sourceMapUrl in the extracted css file.

Actual output:
/*# sourceMappingURL=../../../../entry.map*/

Version info:
webpack : 4.16.3
css-loader : 0.28.11
mini-css-extract-plugin : 0.4.1

Any help is appreciated. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions