How to "build" *.min.js and *.min.js.map files using Eclipse JSDT (JavaScript Developement Tools)?
how to minify JavaScript files using Eclipse JSDT?
4.6k views Asked by user2449761 At
2
There are 2 answers
1
On
I use YUICompressor. It works on both JavaScript and CSS. Once it's installed, it's easy to use:
- Right-click the JS file you'd like to minimize
- Go to External Tools > Compress Javascript
- Specify the name of the compressed file and click Finish
Unfortunately, you will need to manually run the compressor every time you change the original file, which can get tedious if you're working with lots of files. If you want to automate the process, see this answer. I ended up writing a quick batch script for my project.
You can use an external builder to run build scripts for your Javascript tasks.
Go to Project --> Properties and choose Builders. Then you can add an external builder to launch an external program with whatever arguments you need.
You can se the builder to run automatically by using the Build Options tab and setting the "Run The Builder:" options: