From 3860835084ec8e7366d50f33beecf73ab74385fe Mon Sep 17 00:00:00 2001 From: Hakyeon Kim Date: Mon, 13 Jan 2025 19:36:28 +0900 Subject: [PATCH] fix: correct putout options --- lib/js.js | 2 +- test/minify.js | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/js.js b/lib/js.js index d2d2d5c..a738d4c 100644 --- a/lib/js.js +++ b/lib/js.js @@ -50,5 +50,5 @@ export default async (source, userOptions) => { return code; } - return await minify(source, options); + return await minify(source, options.putout); }; diff --git a/test/minify.js b/test/minify.js index 06c2fc6..d467f7f 100644 --- a/test/minify.js +++ b/test/minify.js @@ -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, + }, }, }); @@ -100,8 +102,10 @@ test('minify: js: with alternate options', async (t) => { const options = { js: { - removeConsole: true, - removeUnusedVariables: false, + putout: { + removeConsole: true, + removeUnusedVariables: false, + }, }, }; @@ -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, + }, }, });