Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

glob not working with cli #1035

Closed
justclint opened this issue May 2, 2020 · 2 comments
Closed

glob not working with cli #1035

justclint opened this issue May 2, 2020 · 2 comments

Comments

@justclint
Copy link

Using cli Im trying to recursively minify files like:

node-minify --compressor uglify-js --input 'source/**/*.js' --output 'source/**/*.min.js' --option '{"warnings": true, "mangle": false}'

but throws error:

✖ Error - file(s) not compressed with uglify-js
{ Error: ENOENT: no such file or directory, stat 'source/**'
    at Object.statSync (fs.js:855:3)
    at createDirectory (/var/www/project/node_modules/@node-minify/core/lib/compress.js:102:20)
    at compress (/var/www/project/node_modules/@node-minify/core/lib/compress.js:36:3)
    at Promise (/var/www/project/node_modules/@node-minify/core/lib/core.js:30:7)
    at new Promise (<anonymous>)
    at minify (/var/www/project/node_modules/@node-minify/core/lib/core.js:25:10)
    at Promise (/var/www/project/node_modules/@node-minify/cli/lib/compress.js:31:23)
    at new Promise (<anonymous>)
    at compress (/var/www/project/node_modules/@node-minify/cli/lib/compress.js:30:10)
    at Promise (/var/www/project/node_modules/@node-minify/cli/lib/cli.js:52:35)
  errno: -2,
  syscall: 'stat',
  code: 'ENOENT',
  path: 'source/**' }

In the example above, I just want to minify all js files recursively and save the minified file in the same folder as its source js file.

Is glob not supported or is there another method/syntax to do this?

Thanks!

@srod
Copy link
Owner

srod commented Jun 24, 2020

Fixed in 6.0.0.

@srod srod closed this as completed Jun 24, 2020
@srod
Copy link
Owner

srod commented Jun 24, 2020

You should use that command:

node-minify --compressor uglify-js --input 'source/**/*.js' --output 'source/$1.min.js' --option '{"warnings": true, "mangle": false}'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants