draft: refactor project so it sits on top of a standalone app
This commit is contained in:
Generated
Vendored
+1
@@ -0,0 +1 @@
|
||||
body{color:red}a{color:blue}
|
||||
Generated
Vendored
+1
@@ -0,0 +1 @@
|
||||
body{margin:0;color:red}p{margin:1000px}
|
||||
Generated
Vendored
+1
@@ -0,0 +1 @@
|
||||
body{color:red;padding:0;margin:0}p{padding:500px;padding:1000px}
|
||||
Generated
Vendored
+1
@@ -0,0 +1 @@
|
||||
body{color:red}a{color:blue}body{margin:0;color:red}p{margin:1000px}body{color:red;padding:0;margin:0}p{padding:500px;padding:1000px}
|
||||
Generated
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
|
||||
This test is here to confirm that assetNameRegExp option will apply
|
||||
only to the names of the files exported byt ExtractTextPlugin
|
||||
|
||||
*/
|
||||
|
||||
require('./a_optimize-me.css');
|
||||
require('./b_optimize-me.css');
|
||||
require('./c.css');
|
||||
Generated
Vendored
+25
@@ -0,0 +1,25 @@
|
||||
import ExtractTextPlugin from 'extract-text-webpack-plugin';
|
||||
import OptimizeCssAssetsPlugin from '../../../src/';
|
||||
|
||||
module.exports = {
|
||||
entry: './index',
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: ExtractTextPlugin.extract({
|
||||
fallback: { loader: 'style-loader' },
|
||||
use: {
|
||||
loader: 'css-loader'
|
||||
}
|
||||
})
|
||||
},
|
||||
],
|
||||
},
|
||||
plugins: [
|
||||
new ExtractTextPlugin('file.css'),
|
||||
new OptimizeCssAssetsPlugin({
|
||||
assetNameRegExp: /optimize-me\.css/g
|
||||
})
|
||||
],
|
||||
};
|
||||
Generated
Vendored
+1
@@ -0,0 +1 @@
|
||||
body{color:red}a{color:blue}
|
||||
Generated
Vendored
+1
@@ -0,0 +1 @@
|
||||
body{color:red}p{color:green}
|
||||
Generated
Vendored
+1
@@ -0,0 +1 @@
|
||||
body{color:red}a{color:blue}body{color:red}p{color:green}
|
||||
Generated
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
require('./a.css');
|
||||
require('./b.css');
|
||||
Generated
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
import ExtractTextPlugin from "extract-text-webpack-plugin";
|
||||
import OptimizeCssAssetsPlugin from "../../../src/";
|
||||
|
||||
module.exports = {
|
||||
entry: "./index",
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: ExtractTextPlugin.extract({
|
||||
fallback: { loader: "style-loader" },
|
||||
use: {
|
||||
loader: "css-loader"
|
||||
}
|
||||
})
|
||||
}
|
||||
]
|
||||
},
|
||||
plugins: [new ExtractTextPlugin("file.css")]
|
||||
};
|
||||
Generated
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
body {
|
||||
color: red;
|
||||
}
|
||||
a {
|
||||
color: blue;
|
||||
}
|
||||
Generated
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
body {
|
||||
margin: 0;
|
||||
color: red;
|
||||
}
|
||||
p {
|
||||
margin: 1000px;
|
||||
}
|
||||
Generated
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
body {
|
||||
color: red;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
p {
|
||||
padding: 500px;
|
||||
padding: 1000px;
|
||||
}
|
||||
Generated
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
body {
|
||||
color: red;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
p {
|
||||
padding: 500px;
|
||||
padding: 1000px;
|
||||
}
|
||||
Generated
Vendored
+1
@@ -0,0 +1 @@
|
||||
a{color:#00f}body{margin:0;color:red}p{margin:1000px}
|
||||
Generated
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
require('./a_optimize-me.css');
|
||||
require('./b_optimize-me.css');
|
||||
require('./c_as-is.css');
|
||||
Generated
Vendored
+38
@@ -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
|
||||
})
|
||||
]
|
||||
};
|
||||
Generated
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
body {
|
||||
color: red;
|
||||
}
|
||||
a {
|
||||
color: blue;
|
||||
}
|
||||
Generated
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
body {
|
||||
color: red;
|
||||
}
|
||||
p {
|
||||
color: green;
|
||||
}
|
||||
Generated
Vendored
+1
@@ -0,0 +1 @@
|
||||
a{color:#00f}body{color:red}p{color:green}
|
||||
Generated
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
require('./a.css');
|
||||
require('./b.css');
|
||||
Generated
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
import ExtractTextPlugin from "extract-text-webpack-plugin";
|
||||
import OptimizeCssAssetsPlugin from "../../../src/";
|
||||
|
||||
module.exports = {
|
||||
entry: "./index",
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: ExtractTextPlugin.extract({
|
||||
fallback: { loader: "style-loader" },
|
||||
use: {
|
||||
loader: "css-loader"
|
||||
}
|
||||
})
|
||||
}
|
||||
]
|
||||
},
|
||||
plugins: [new ExtractTextPlugin("file.css"), new OptimizeCssAssetsPlugin()]
|
||||
};
|
||||
Reference in New Issue
Block a user