GoScrobble/web/node_modules/optimize-css-assets-webpack-plugin/test/cases/only-assetNameRegExp-processed/webpack.config.js

39 lines
847 B
JavaScript
Raw Normal View History

2022-04-25 02:47:15 +00:00
import ExtractTextPlugin from "extract-text-webpack-plugin";
import OptimizeCssAssetsPlugin from "../../../src/";
const notToProcess = new ExtractTextPlugin("as_is.css");
const toProcess = new ExtractTextPlugin("optimize.css");
module.exports = {
entry: "./index",
module: {
rules: [
{
test: /as-is\.css$/,
use: notToProcess.extract({
fallback: { loader: "style-loader" },
use: {
loader: "css-loader"
}
})
},
{
test: /optimize-me\.css$/,
use: toProcess.extract({
fallback: { loader: "style-loader" },
use: {
loader: "css-loader"
}
})
}
]
},
plugins: [
notToProcess,
toProcess,
new OptimizeCssAssetsPlugin({
assetNameRegExp: /optimize\.css/g
})
]
};