我当前的配置分别捆绑了Javascript和CSS。但是,我有特定的样式和JS只与我网站上的管理仪表板相关,我不希望它们包含在styles.css
样式表中。
是否可以这样做?
这是我当前的Webpack配置:
var path = require('path');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
entry: './lib/js/entry.js',
output: {
path: path.resolve(__dirname, 'public'),
filename: 'main.js'
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
use: 'babel-loader'
},
{
test: /\.css$/,
use: ExtractTextPlugin.extract({
fallbackLoader: 'style-loader',
loader: [
'css-loader?importLoaders=1',
'postcss-loader'
]
})
},
{ test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "url-loader?limit=10000&minetype=application/font-woff" },
{ test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "file-loader" }
]
},
plugins: [
new ExtractTextPlugin("styles.css")
]
}