webpack-china / webpack-issues

社区成立早期问题收集处
7 stars 0 forks source link

how webpack3.0 extract multiple css files #7

Closed lt978613 closed 6 years ago

lt978613 commented 6 years ago

This is my config: var glob = require('glob'); var EX = require('extract-text-webpack-plugin'); var entryFiles = []; var sassFiles = glob.sync(__dirname + '/src/static/sass/**/*.scss'); entryFiles = entryFiles.concat(sassFiles); module.exports = { entry:entryFiles, output: { path: __dirname + "/dist", filename: '[name].css' }, module: { rules: [{ test: /\.scss$/, use:EX.extract({ publicPath:__dirname + '/dist/static/css', //publicPath fallback:"style-loader", use:[ 'css-loader', 'sass-loader' ] }) }] }, plugins:[ new EX({ filename:'[name].css', allChunks:true }) ] } there are two sass files a.scss and b.scss in the specified folder,but the budle result has only one file name of main.css and it is the combile of the two files.