//下面的是对create-react-app配置中对css的配置constcssFilename='static/css/[name].[contenthash:8].css';constextractTextPluginOptions=shouldUseRelativeAssetPaths?{publicPath:Array(cssFilename.split('/').length).join('../')}:{};{test:/\.css$/,loader:ExtractTextPlugin.extract(Object.assign({fallback:require.resolve('style-loader'),use:[{loader:require.resolve('css-loader'),options:{importLoaders:1,minimize:true,sourceMap:true,},},{loader:require.resolve('postcss-loader'),options:{ident:'postcss',//https://webpack.js.org/guides/migrating/#complex-optionsplugins:()=>[require('postcss-flexbugs-fixes'),autoprefixer({browsers:['>1%','last4versions','FirefoxESR','notie<9',//Reactdoesn'tsupportIE8anyway],flexbox:'no-2009',}),],},},],},extractTextPluginOptions)),//Note:thiswon'tworkwithout`newExtractTextPlugin()`in`plugins`.},newExtractTextPlugin({filename:cssFilename,}),这个配置打包分离出来的css都只有main.css一个文件,怎样才能把引入的css,比如comm.css;header.css这种单独的css分离出来呢
拉风的咖菲猫
相关分类