Skip to content
This repository has been archived by the owner on Mar 16, 2020. It is now read-only.

breaks bundling #78

Closed
ghost opened this issue Feb 3, 2018 · 1 comment
Closed

breaks bundling #78

ghost opened this issue Feb 3, 2018 · 1 comment

Comments

@ghost
Copy link

ghost commented Feb 3, 2018

Hello,

// webpack.config.js
const path = require("path");
const MinifyPlugin = require("babel-minify-webpack-plugin");

module.exports = {
  devtool: "source-map",
  entry: "./src/index.js",
  output: {
    path: path.join(__dirname, "artifact"),
    filename: "bundle.js"
  },
  module: {
    rules: [
      {
        enforce: "pre",
        test: /\.js$/,
        exclude: /node_modules/,
        loader: "eslint-loader"
      },
      {
        test: /\.js$/,
        exclude: /node_modules/,
        loader: "babel-loader"
      }
    ]
  },
  plugins: [new MinifyPlugin()]
};

leads to

$ webpack
/home/le93us/Desktop/php-study/node_modules/webpack-sources/node_modules/source-map/lib/source-map-generator.js:276
        throw new Error(
        ^

Error: original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.
    at SourceMapGenerator_validateMapping [as _validateMapping] (/home/le93us/Desktop/php-study/node_modules/webpack-sources/node_modules/source-map/lib/source-map-generator.js:276:15)
    at SourceMapGenerator_addMapping [as addMapping] (/home/le93us/Desktop/php-study/node_modules/webpack-sources/node_modules/source-map/lib/source-map-generator.js:110:12)
    at /home/le93us/Desktop/php-study/node_modules/webpack-sources/node_modules/source-map/lib/source-map-generator.js:72:17
    at Array.forEach (<anonymous>)
    at BasicSourceMapConsumer.SourceMapConsumer_eachMapping [as eachMapping] (/home/le93us/Desktop/php-study/node_modules/webpack-sources/node_modules/source-map/lib/source-map-consumer.js:157:14)
    at Function.SourceMapGenerator_fromSourceMap [as fromSourceMap] (/home/le93us/Desktop/php-study/node_modules/webpack-sources/node_modules/source-map/lib/source-map-generator.js:48:24)
    at SourceMapSource.node (/home/le93us/Desktop/php-study/node_modules/webpack-sources/lib/SourceMapSource.js:32:35)
    at SourceMapSource.proto.sourceAndMap (/home/le93us/Desktop/php-study/node_modules/webpack-sources/lib/SourceAndMapMixin.js:30:18)
    at getTaskForFile (/usr/lib/node_modules/webpack/lib/SourceMapDevToolPlugin.js:33:30)
    at chunk.files.forEach.file (/usr/lib/node_modules/webpack/lib/SourceMapDevToolPlugin.js:91:21)
    at Array.forEach (<anonymous>)
    at /usr/lib/node_modules/webpack/lib/SourceMapDevToolPlugin.js:89:18
    at Array.forEach (<anonymous>)
    at Compilation.<anonymous> (/usr/lib/node_modules/webpack/lib/SourceMapDevToolPlugin.js:88:12)
    at Compilation.applyPlugins1 (/usr/lib/node_modules/webpack/node_modules/tapable/lib/Tapable.js:75:14)
    at self.applyPluginsAsync.err (/usr/lib/node_modules/webpack/lib/Compilation.js:670:11)
    at next (/usr/lib/node_modules/webpack/node_modules/tapable/lib/Tapable.js:202:11)
    at Compilation.<anonymous> (/home/le93us/Desktop/php-study/node_modules/babel-minify-webpack-plugin/dist/index.js:119:11)
    at Compilation.applyPluginsAsyncSeries (/usr/lib/node_modules/webpack/node_modules/tapable/lib/Tapable.js:206:13)
    at self.applyPluginsAsync.err (/usr/lib/node_modules/webpack/lib/Compilation.js:666:10)
    at Compilation.applyPluginsAsyncSeries (/usr/lib/node_modules/webpack/node_modules/tapable/lib/Tapable.js:195:46)
    at sealPart2 (/usr/lib/node_modules/webpack/lib/Compilation.js:662:9)
    at Compilation.applyPluginsAsyncSeries (/usr/lib/node_modules/webpack/node_modules/tapable/lib/Tapable.js:195:46)
    at Compilation.seal (/usr/lib/node_modules/webpack/lib/Compilation.js:605:8)
    at applyPluginsParallel.err (/usr/lib/node_modules/webpack/lib/Compiler.js:504:17)
    at /usr/lib/node_modules/webpack/node_modules/tapable/lib/Tapable.js:289:11
    at _addModuleChain (/usr/lib/node_modules/webpack/lib/Compilation.js:507:11)
    at processModuleDependencies.err (/usr/lib/node_modules/webpack/lib/Compilation.js:477:14)
    at process._tickCallback (internal/process/next_tick.js:150:11)

If disable plugin, all works ok.

Can someone help?

@alexander-akait
Copy link
Member

@le93us Thanks for issue. Duplicate #68, can you create minimum reproducible test repo and put in issue #68?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant