Skip to content

Commit 9ce96e8

Browse files
test: fix
1 parent 93e69d2 commit 9ce96e8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/minify-option.test.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ describe('"minify" option', () => {
3434
});
3535

3636
new CssMinimizerPlugin({
37-
minify: async (data, inputMap) => {
37+
minify: async (data, inputSourceMap) => {
3838
// eslint-disable-next-line global-require
3939
const csso = require("csso");
4040
// eslint-disable-next-line global-require
@@ -43,19 +43,19 @@ describe('"minify" option', () => {
4343
const [[filename, input]] = Object.entries(data);
4444
const minifiedCss = csso.minify(input, {
4545
filename,
46-
sourceMap: true,
46+
sourceMap: inputSourceMap,
4747
});
4848

49-
if (inputMap) {
49+
if (inputSourceMap) {
5050
minifiedCss.map.applySourceMap(
51-
new sourcemap.SourceMapConsumer(inputMap),
51+
new sourcemap.SourceMapConsumer(inputSourceMap),
5252
filename
5353
);
5454
}
5555

5656
return {
5757
code: minifiedCss.css,
58-
map: minifiedCss.map.toJSON(),
58+
map: minifiedCss.map && minifiedCss.map.toJSON(),
5959
};
6060
},
6161
}).apply(compiler);

0 commit comments

Comments
 (0)