arsors / uglify-merge-js

Merge and Uglify JavaScript files in one step!
GNU Lesser General Public License v3.0
1 stars 0 forks source link

"No root JavaScript file was found!" while trying to compile whole folder #7

Closed jerry1970 closed 3 years ago

jerry1970 commented 3 years ago

The README says "You can also just merge a complete folder with JavaScript files without the Root JavaScript file.". That's what I am trying to do.

Files in /var/www/my-proj/js/:

first-script.js
second-script.js
jquery-3.6.0.min.js

Command line:

/var/www/my-proj/node_modules/.bin/uglify-merge
  --src /var/www/my-proj/js/
  --output ../../public_html/assets/js/my-proj.min.js
  --uglify {\"mangle\":{}}

I get this error:

No root JavaScript file was found!

The output file is not generated, still I get exit code 0.

Using the root.js with imports it seems to work, but if I wanted the whole directory without the root.js, that would save me maintaining a file.

MarcoPNS commented 3 years ago

Hi! You can use uglify-merge in two ways. With a root file and without a root file. If you don't want to use a root file, you need to add the option -a

jerry1970 commented 3 years ago

Doh! Completely missed the -a... Thanks!