慕码人8056858
设置多个ExtractTextPlugin比如...const ExtractTextPlugin1 = require("extract-text-webpack-plugin");const ExtractTextPlugin2 = require("extract-text-webpack-plugin");.... ... rules:[ { test:/\.less$/, include:[path.resolve(__dirname, "./less")], use: ExtractTextPlugin1.extract({ fallback: "style-loader", use: [ 'css-loader?minimize=true', 'less-loader' ] }) }, { test:/\.css$/, include:[path.resolve(__dirname, "./css")], use: ExtractTextPlugin2.extract({ fallback: "style-loader", use: [ 'css-loader?minimize=true'] }) }, ] ... plugins: [ ... new ExtractTextPlugin1('1.css'), new ExtractTextPlugin2('2.css') ]这样less文件打包就到1.css,普通css文件打包就到2.css,js里的css也同理。只需要把include文件位置设置好,对应的path打包进对应的ExtractTextPlugin就OK