Skip to content

Commit

Permalink
test: empty chunk
Browse files Browse the repository at this point in the history
  • Loading branch information
evilebottnawi committed Oct 2, 2020
1 parent 0494230 commit ef4bd79
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 4 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -74,7 +74,7 @@
"npm-run-all": "^4.1.5",
"prettier": "^2.1.1",
"standard-version": "^9.0.0",
"webpack": "^4.44.1",
"webpack": "^4.44.2",
"webpack-cli": "^3.3.6",
"webpack-dev-server": "^3.7.2"
},
Expand Down
1 change: 1 addition & 0 deletions test/cases/split-chunks-all/a.js
@@ -0,0 +1 @@
import './style.css';
1 change: 1 addition & 0 deletions test/cases/split-chunks-all/b.js
@@ -0,0 +1 @@
import './style.css';
4 changes: 4 additions & 0 deletions test/cases/split-chunks-all/expected/webpack-4/styles~a~b.css
@@ -0,0 +1,4 @@
body {
background: red;
}

4 changes: 4 additions & 0 deletions test/cases/split-chunks-all/expected/webpack-5/2.css
@@ -0,0 +1,4 @@
body {
background: red;
}

1 change: 1 addition & 0 deletions test/cases/split-chunks-all/index.js
@@ -0,0 +1 @@
import './style.css';
3 changes: 3 additions & 0 deletions test/cases/split-chunks-all/style.css
@@ -0,0 +1,3 @@
body {
background: red;
}
36 changes: 36 additions & 0 deletions test/cases/split-chunks-all/webpack.config.js
@@ -0,0 +1,36 @@
import webpack from 'webpack';

import Self from '../../../src';

module.exports = {
entry: {
a: './a.js',
b: './b.js',
},
module: {
rules: [
{
test: /\.css$/,
use: [Self.loader, 'css-loader'],
},
],
},
optimization: {
splitChunks: {
cacheGroups: {
styles:
webpack.version[0] === '4'
? {
chunks: 'all',
enforce: true,
}
: {
type: 'css/mini-extract',
chunks: 'all',
enforce: true,
},
},
},
},
plugins: [new Self()],
};

0 comments on commit ef4bd79

Please sign in to comment.