Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Closure compiler skip file

I have a shell script that collects all the .js files on a page and concats them to be compiled using the closure compiler. However, I don't want a specific js file to optimized any via the compiler. For example, I have the command to compile fileA.js, fileB.js, and fileC.js. How do I notate to skip fileB.js but still place it in the output file scripts.min.js in the correct order? So, fileA.js and fileC.js would be optimized using SIMPLE_OPTIMIZATION and fileB.js wouldn't be touched. Is there a keyword I can place in the comments of the file itself that says, skip this file?

java -jar compiler.jar --js=fileA.js --js=fileB.js --js=fileC.js --js_output_file=scripts.min.js
like image 983
jaysonp Avatar asked Sep 20 '25 19:09

jaysonp


1 Answers

If I understand your intent here, you may consider processing each file that you want to minify separately, then performing the concatenation as a separate step. In pseudo-code:

minify fileA.js
minify fileC.js
cat fileA.js fileB.js fileC.js >scripts.min.js
like image 197
Derek Slager Avatar answered Sep 22 '25 09:09

Derek Slager