new SuppressChunksPlugin([
^
TypeError: SuppressChunksPlugin 不是 Object 的构造函数。(/Users/rohit/WebstormProjects/myProjectStructure/webpack.config.js:80:9) 在 Module._compile (module.js:570:32) 在 Object.Module._extensions..js (module.js:579:10 ) 在 Module.load (module.js:487:32) 在 tryModuleLoad (module.js:446:12) 在 Function.Module._load (module.js:438:3) 在 Module.require (module.js:497 :17) 在 require (internal/module.js:20:19) 在 requireConfig (/usr/local/lib/node_modules/webpack/bin/convert-argv.js:97:18) 在 /usr/local/lib/ node_modules/webpack/bin/convert-argv.js:104:17
以下是网络配置文件。
var path = require('path');
var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var SuppressChunksPlugin = require('suppress-chunks-webpack-plugin');
module.exports = {
context: path.resolve(__dirname, './src'),
entry: {
blitz: './blitz.js',
},
output: {
path: path.resolve(__dirname, './dist/assets'),
filename: '[name].bundle.js'
},
module: {
rules: [
{
test: /\.less$/,
use: ExtractTextPlugin.extract({
// use style-loader in development
fallback: 'style-loader',
use: 'css-loader?minimize!less-loader'
})
},
{
test: /\.css$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use:'css-loader?minimize'
})
}
]
},
plugins:[
new ExtractTextPlugin('[name].css'),
new SuppressChunksPlugin([
{name: 'blitz', match: /\.js$/},
])
]
};