Skip to content

Commit d8575f8

Browse files
feat: run optimize against assets added later by plugins (webpack@5 only)
1 parent 992be65 commit d8575f8

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

test/CssMinimizerPlugin.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1125,12 +1125,12 @@ describe('CssMinimizerPlugin', () => {
11251125
],
11261126
},
11271127
});
1128+
11281129
new CssMinimizerPlugin({
11291130
minimizerOptions: {
11301131
preset: ['default', { discardEmpty: false }],
11311132
},
11321133
}).apply(compiler);
1133-
11341134
new EmitNewAsset({ name: 'newFile.css' }).apply(compiler);
11351135

11361136
const stats = await compile(compiler);

test/__snapshots__/CssMinimizerPlugin.test.js.snap.webpack5

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,16 @@ exports[`CssMinimizerPlugin should respect the hash options #1: errors 1`] = `Ar
5959

6060
exports[`CssMinimizerPlugin should respect the hash options #1: warnings 1`] = `Array []`;
6161

62+
exports[`CssMinimizerPlugin should run plugin against assets added later by plugins: assets 1`] = `
63+
Object {
64+
"newFile.css": ".a{display:block;color:coral}",
65+
}
66+
`;
67+
68+
exports[`CssMinimizerPlugin should run plugin against assets added later by plugins: errors 1`] = `Array []`;
69+
70+
exports[`CssMinimizerPlugin should run plugin against assets added later by plugins: warnings 1`] = `Array []`;
71+
6272
exports[`CssMinimizerPlugin should throw error from postcss: error 1`] = `
6373
Array [
6474
"Error: foo.css from Css Minimizer

0 commit comments

Comments
 (0)