先安装css-loader和style-loader
然后
//抽离css
{ test: /.css$/, loader: ExtractTextPlugin.extract('style', 'css') }
如果你还要sass之类的要单独打包
{ test: /.scss$/, loader: ExtractTextPlugin.extract('style', 'css!sass') }
单独打包的路径是
plugins: [
new ExtractTextPlugin('css/[name].css')
]
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…