srod/node-minify

CLI node-minify --option : json error

vykimo opened this issue · 1 comments

Hello,
When I'm setting 'minify' in my package.json:
"minify": "node-minify --compressor terser --input ./main.js --output ./main.js --option '{ \"compress\": { \"drop_console\": true } }'",
I get following error for option :

INFO  Starting compression...
SyntaxError: Unexpected token ' in JSON at position 0

Note that without option, it's working well.

Found the solution :
Need to triple \\ for double quote like that :
--option {\\\"compress\\\":{\\\"drop_console\\\":true}}