bugsnag / webpack-bugsnag-plugins

Webpack plugins for common BugSnag actions.
MIT License
32 stars 29 forks source link

`overwrite` not respected for css map files #24

Closed markbrouch closed 5 years ago

markbrouch commented 5 years ago

It looks like when using the upload webpack plugin, the overwrite command is not respected for css map files. (js map files are overwritten as expected).

emittingError: Conflict (409) - duplicate source map file for */assets/app/common.82a452be015613a8991a.css version 02fdfce
markbrouch commented 5 years ago

Side note - why are css map files being uploaded at all? Is there a way to prevent this?

bengourley commented 5 years ago

why are css map files being uploaded at all?

Interesting question! We simply didn't make a conscious choice to exclude them. It's conceivable that errors could originate in a CSS file. However, I've found no examples of this kind, so perhaps we should consider ignoring them.

Can you provide more steps to reproduce, as the overwrite does works for the examples I have tried. Thanks!

markbrouch commented 5 years ago

I wish I could give you steps to reproduce, but unfortunately our application config is very complex. We have a SSR Vue application with Sass compilation. Here's the relevant portion of the style loaders:

module: {
    rules: [
      {
        test: /\.(sass|scss)$/,
        use: [
          {
            loader: 'style-loader/useable',
          },
          {
            loader: 'css-loader', // translates CSS into CommonJS
            options: { minimize: minimizeCSS },
          },
          {
            loader: 'resolve-url-loader',
          },
          {
            loader: 'sass-loader?sourceMap', // compiles Sass to CSS
          },
        ],
      },
      {
        test: /\.css$/,
        use: [
          {
            loader: 'style-loader/useable',
          },
          {
            loader: 'css-loader', // translates CSS into CommonJS
            options: { minimize: minimizeCSS },
          },
          {
            loader: 'resolve-url-loader',
          },
        ],
      },
    ],
  },

I was thinking it might be a good feature to add in the plugin options to configure which files to upload via a regex pattern, that way I could specify something like /.*\.js\.map$/ so that only js map files get uploaded.