0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

(webpack)"contains invalid source map"の原因

Last updated at Posted at 2019-11-26
WARNING in hoge.js contains invalid source map

の原因について。

{terser,uglifyjs}-webpack-pluginのオプションでsource mapが有効化されていない時に発生するので

const TerserPlugin = require("terser-webpack-plugin");
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');

module.exports = {
  ...
  plugins: [
    new TerserPlugin({
+     sourceMap: true,
      ...
    }),
    // もしくは
    new UglifyJsPlugin({
+     sourceMap: true,
      ...
    })
  ],
  ...
};

とすることでこの問題が解決します。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?