This script runs several tools that should optimize JavaScript files by removing unused code. It will take the application in the default/ folder and run the tool on the main HTML file (default index.html) and main JS file (default js/app.js). Script files will be extracted from the HTML file for the closure compiler. Rollup and Webpack use the main JS file. The script outputs a table with the amount of function keywords in the resulting JS source and the number of JS errors, if any.
Depending on your machine's speed, you might want to increase the chrome_timeout value in tooltest.sh.
Requires the following:
- Chromium (
chromium-browser
) - Node.js (
nodejs-legacy
) - Google closure compiler (
closure-compiler
) - Xvfb (
xvfb
)
And the following npm modules:
- webpack (
webpack
) - rollup (
rollup
)
./tooltest.sh
This should create a folder for each tool. To remove all created folders, run
./tooltest.sh clean