Skip to content

Commit cd23644

Browse files
test: add example (#828)
1 parent 3f68b80 commit cd23644

File tree

7 files changed

+72
-0
lines changed

7 files changed

+72
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/* This could be bootstrap.css */
2+
body {
3+
background: green;
4+
}
5+
6+
body {
7+
background: red;
8+
}
9+
10+
.async {
11+
color: red;
12+
}
13+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// eslint-disable-next-line import/no-extraneous-dependencies
2+
import "bootstrap/bootstrap.css";
3+
import "./style.css";
4+
5+
// eslint-disable-next-line import/first
6+
import "package/index";
7+
8+
import("other-css/other.css");

test/cases/split-chunks-no-vendor/node_modules/bootstrap/bootstrap.css

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/cases/split-chunks-no-vendor/node_modules/other-css/other.css

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/cases/split-chunks-no-vendor/node_modules/package/index.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
body {
2+
background: red;
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import Self from "../../../src";
2+
3+
module.exports = {
4+
entry: "./index.js",
5+
module: {
6+
rules: [
7+
{
8+
test: /\.css$/,
9+
use: [Self.loader, "css-loader"],
10+
},
11+
],
12+
},
13+
optimization: {
14+
splitChunks: {
15+
chunks: "all",
16+
cacheGroups: {
17+
default: false,
18+
vendors: false,
19+
vendor: {
20+
test: /[\\/]node_modules[\\/]/,
21+
name: "vendor",
22+
chunks: "all",
23+
enforce: true,
24+
},
25+
styles: {
26+
name: "bundle",
27+
type: "css/mini-extract",
28+
chunks: "all",
29+
priority: 100,
30+
enforce: true,
31+
},
32+
},
33+
},
34+
},
35+
plugins: [
36+
new Self({
37+
filename: "[name].css",
38+
}),
39+
],
40+
};

0 commit comments

Comments
 (0)