webpack编译速度极慢

eatnothing 发布于 2016/11/02 09:37
阅读 1K+
收藏 0
module.exports = {
    entry: {
        "public/js/claim/chc-claim-result-detail"        : __dirname + "/../datebaoladder-front/public/js/claim_src/chc-claim-result-detail"

    },
    output: {
        path: __dirname ,
        filename: '[name].js',
    },
    resolve: {
        extensions: ['', '.js', '.jsx']
    },
   // devtool: "#source-map",
    module: {
        loaders: [
            {
                test: /\.js$/,
                exclude: /node_modules/,
                loader: 'babel',
                query: {
                    presets: ['react', 'es2015']
                }
            }
        ]
    }
    //,watch:true
}

编译一次大概40s,怎么破



加载中
0
quanwei9958
quanwei9958

可以使用HappyPack plugin,支持并行编译

另外如果是开发可以使用 webpack-dev-server 

返回顶部
顶部