Functionality
Usage
Install dependencies
All dependencies needed to run the tests are pre-configured in package.json
. You just need to install these:
npm install
Note: it's smart to update to the latest versions of these dependencies.
Configure in- and output directory
Adjust the inputDir
and outputDir
in scripts/compress.js
(both default to dist/
).
Run compress script
Compress all files in inputDir
and write to outputDir
:
npm run compress
Note: This setup contains an example file in dist/examples/
.
As this setup uses the inputDir
as the outputDir
the compressed files are placed right next to the original.
Configure server to use precompressed files
You'll need to configure your server to serve the precompressed files when available. In addition you can enable on-the-fly compression of dynamic assets.