Webpack构建失败,但未打印任何错误

时间:2018-11-04 09:55:20

标签: javascript webpack

我正在用webpack来编译node

运行简单的webpack(webpackconfig).run((err,stats) =>{...

现在的事情是我的代码有错误,但是当webpack完成时,err对象为空,而stats.toJson().hasErrors未定义。因为我使用NoErrorsPlugin,所以未创建捆绑包...但是我的问题是我在控制台上没有通知。

我的webpack配置类似于:

import webpack from 'webpack';
import path from 'path';
import ExtractTextPlugin from 'extract-text-webpack-plugin';

export default {
  entry: ['babel-polyfill', 'fetch-polyfill', './src/index'],
  target: 'web',
  output: {
    path: __dirname + '/dist', 
    publicPath: '/',
    filename: 'bundle.js'
  },
  devServer: {
    contentBase: './dist'
  },
  plugins: [
    new webpack.optimize.OccurenceOrderPlugin(),
    new ExtractTextPlugin('styles.css'),
    new webpack.optimize.DedupePlugin(),
    new webpack.IgnorePlugin(/^\.\/locale$/, [/moment$/]),
    new webpack.NoErrorsPlugin(),
  ],
  module: {
    loaders: [
    ]
  },
  node: {
    fs: "empty",
    child_process: 'empty',
  }
};

0 个答案:

没有答案