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

Can't remove source maps after build

Open zephy20 opened this issue 5 years ago • 1 comments

My build folder looks something like this:

Screenshot 2020-05-01 at 8 15 00 PM

and my webpack config looks something like this:

  if (!isDev) {
            const SentryWebpackPlugin = require("@sentry/webpack-plugin");
            config.plugins.push(
              new SentryWebpackPlugin({
                release: buildId,
                include: ".next",
                configFile: ".sentryclirc"
              })
            );
          }

          config.plugins.push(
            new CleanWebpackPlugin({
              cleanAfterEveryBuildPatterns: ["**/*.map"],
              protectWebpackAssets: false
            })
          );

I want to delete the source maps after sentry uploads them. But this doesn't happen. I can still see the source maps and sentry doesn't show me the source map referenced error.

I am using Nextjs with next-source-maps for creating source maps.

Been stuck on this for hours. Any help?

zephy20 avatar May 01 '20 14:05 zephy20

I comfront the same issue, but when I set protectWebpackAssets false it works, Have you resolve that problem?

scplay avatar Jan 01 '21 15:01 scplay