运行webpack-dev-server时出现错误模块构建失败:TypeError:text.forEach不是函数enter image description here

'use strict';

var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');

var path = require('path');

module.exports = {
entry: {
    app: ['./client/main.js'],

    index: ['./server/index.pug']
},

output: {
    path: path.resolve(__dirname, "..", "public",'js'),
    publicPath: "/js/",
    filename: '[name].js'
},

module: {
    rules: [
       {
           test: /\.pug$/,
           loader: ExtractTextPlugin.extract( 'pug-loader')
       },
       {
           test: /\.js$/,
           loader: "babel-loader",
           exclude: /node_modules/,
           query: {
                presets: ['es2015']
            }
       },
       {
            test: /\.scss$/,
            loader: ExtractTextPlugin.extract({
                fallback: "style-loader",
                use: [{
                    loader: "css-loader"
                }, {
                    loader: "postcss-loader"
                }, {
                    loader: "sass-loader"
                }]
            })
        }, 
        {
            test: /\.vue$/,
            loader: "vue-loader"
        }
    ]
},

resolve: {
    extensions: [".vue", ".js", ".json",".pug",".html"],
    alias: {
        'vue$': 'vue/dist/vue.common.js'
    }
},

plugins: [
    new ExtractTextPlugin("[name].html"),
    new ExtractTextPlugin("[name].css"),
    new webpack.NoEmitOnErrorsPlugin(),
    new webpack.optimize.CommonsChunkPlugin({
        name: "main",
        minChunks: 2
    })
],
}

在此之前,我试图通过HtmlWebpackPlugin来做,但它返回纯文本!