diff --git a/README.md b/README.md index 9b9bdb9..31f11ac 100644 --- a/README.md +++ b/README.md @@ -59,9 +59,14 @@ For development: pushd app && ng build && popd -For production (shakes tree and minifies to get smaller size): +For production (shakes tree, minifies and gzips to get smaller size): - pushd app && ng build --prod && popd + pushd app + ng build --prod + for f in $(find dist -type f -not -name '*.html' -not -name '*.png'); do + gzip --best "$f"; + done + popd ## Generate server certificates diff --git a/bin/server.js b/bin/server.js index 510760e..3e82d55 100755 --- a/bin/server.js +++ b/bin/server.js @@ -200,7 +200,8 @@ function main() { // where to serve static content from let staticHandler = mod_restify.plugins.serveStatic({ directory: 'static', - default: 'index.html' + default: 'index.html', + gzip: true }); server.get(STATIC_RE, function staticFunnel(req, res, next) { staticHandler(req, res, function fileFound(err) {