Skip to content

Commit

Permalink
fix: correct putout options (#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
aooen authored Jan 13, 2025
1 parent 600bbc6 commit 51ec950
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/js.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,5 @@ export default async (source, userOptions) => {
return code;
}

return await minify(source, options);
return await minify(source, options.putout);
};
14 changes: 10 additions & 4 deletions test/minify.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ test('minify: auto', async (t) => {
const js = 'function hello(world) {\nconsole.log(world);\n}';
const result = await minify.auto(js, {
js: {
removeUnusedVariables: false,
putout: {
removeUnusedVariables: false,
},
},
});

Expand All @@ -100,8 +102,10 @@ test('minify: js: with alternate options', async (t) => {

const options = {
js: {
removeConsole: true,
removeUnusedVariables: false,
putout: {
removeConsole: true,
removeUnusedVariables: false,
},
},
};

Expand All @@ -115,7 +119,9 @@ test('minify: auto: not found', async (t) => {
const js = 'hello world';
const result = await minify.auto(js, {
js: {
removeUnusedVariables: false,
putout: {
removeUnusedVariables: false,
},
},
});

Expand Down

0 comments on commit 51ec950

Please sign in to comment.