Optimize Static Web Assets
-
Install NodeJS from here
-
Install environment
$ git clone https://github.com/nirantak/web-optim.git && cd web-optim $ npm install
-
Run script and keep watching
$ npm start
or
-
Run script once
$ npm run build
- GulpJS is used to for the build script.
- When run, the script does the following
- Optimize images using gifsicle, jpegtran, optipng, svgo plugins.
- Autoprefixes and cleans CSS files.
- Uglifies JS files.
- Put all your files in the
./src
directory in their respective subdirectories. - The compressed output files will be put in the
./dist
directory.