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, + }, }, });