0.2.0 - Mid migration

This commit is contained in:
Daniel Mason 2022-04-25 14:47:15 +12:00
parent 139e6a915e
commit 7e38fdbd7d
42393 changed files with 5358157 additions and 62 deletions

View file

@ -0,0 +1,6 @@
body {
color: red;
}
a {
color: blue;
}

View file

@ -0,0 +1,7 @@
body {
margin: 0;
color: red;
}
p {
margin: 1000px;
}

View file

@ -0,0 +1,9 @@
body {
color: red;
padding: 0;
margin: 0;
}
p {
padding: 500px;
padding: 1000px;
}

View file

@ -0,0 +1,9 @@
body {
color: red;
padding: 0;
margin: 0;
}
p {
padding: 500px;
padding: 1000px;
}

View file

@ -0,0 +1 @@
a{color:#00f}body{margin:0;color:red}p{margin:1000px}

View file

@ -0,0 +1,3 @@
require('./a_optimize-me.css');
require('./b_optimize-me.css');
require('./c_as-is.css');

View file

@ -0,0 +1,38 @@
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
})
]
};