csso-webpack-plugin icon indicating copy to clipboard operation
csso-webpack-plugin copied to clipboard

sourceMappingURL wrong location

Open dotnetshadow opened this issue 4 years ago • 0 comments

Hi there,

Firstly thank you for such a great project. I'm currently using csso-webpack-plugin with MiniCssExtractPlugin. using the instructions found here:

Code samples

const CssoWebpackPlugin = require('csso-webpack-plugin').default;

module.exports = {
  module: { /* ... */ },
  plugins: [
    new MiniCssExtractPlugin({
      filename: "[name].css",
      chunkFilename: "[id].css"
    }),
    new CssoWebpackPlugin(),
  ]
}

Problem

I would like to output my css into a css folder so I do the following:

If I change the filename for MiniCssExtractPlugin to say filename: "css\[name].css" When the outputted file generated has the following: /*# sourceMappingURL=css\main.min.css.map*/ As you can see it adds the css folder to the url. Ideally the map file is next to the css file so the css part of the url isn't needed.

How can I go about changing that so that it's just taking the filename without the folder?

Specifications

  • CSSO Plugin version: v2.0.0beta1
  • Webpack version: v5.24.0

/cc @zoobestik

dotnetshadow avatar Feb 23 '21 08:02 dotnetshadow