Skip to content

Commit f912d0f

Browse files
refactor: code
1 parent 523e530 commit f912d0f

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ class JsonMinimizerPlugin {
153153
return;
154154
}
155155

156-
output.source = new RawSource(output.json);
156+
output.source = new RawSource(output.output);
157157

158158
await cache.store({ ...output, ...cacheData });
159159
}

src/minify.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ const minify = async (options) => {
1212

1313
const result = JSON.stringify(JSON.parse(input), replacer, space);
1414

15-
return {
16-
json: result,
17-
};
15+
return { output: result };
1816
};
1917

2018
module.exports.minify = minify;

test/__snapshots__/JsonMinimizerPlugin.test.js.snap.webpack5

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
exports[`JsonMinimizerPlugin should emit error when broken json syntax: errors 1`] = `
44
Array [
5-
"Error: broken-json-syntax.json in \\"/test/fixtures\\" from Json Minimizer
5+
"Error: \\"broken-json-syntax.json\\" in \\"/test/fixtures\\" from Json Minimizer:
66
SyntaxError: Unexpected token s in JSON at position 4",
77
]
88
`;

0 commit comments

Comments
 (0)