Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Closure Compiler combine files

I have the following setup in my phpstorm, and I would like to combine my javascript files located in the /js/app and /js/lib folder.

now it's only minifying a single jar, I would like to combine them

enter image description here

like image 807
Kiwi Avatar asked Jun 07 '26 16:06

Kiwi


1 Answers

One simple way to do it:

  1. Create a closure.command file (or whatever you want to name it) in the same directory as your js files. Put Closure command line options in it like so:

--js file1.js

--js file2.js

--js_output_file all.min.js

  1. Edit the Closure file watcher arguments to include "--flagfile closure.command". You will probably want to uncheck the "Create output file from stdout" option.

** Since you want it to operate on js files from different directories you may have to modify the file paths and "Working Directory" option for it to work properly.

like image 60
Aaron Rox Avatar answered Jun 09 '26 05:06

Aaron Rox