From 1b2b69ddd1ef65dbca855077aa4779f35e2c5ea3 Mon Sep 17 00:00:00 2001 From: Matt Pennington Date: Thu, 11 Apr 2019 15:24:22 -0600 Subject: [PATCH] #746 added gzip assets --- js/grunt/buildRunnable.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/js/grunt/buildRunnable.js b/js/grunt/buildRunnable.js index 378ef6cf7..127ca9440 100644 --- a/js/grunt/buildRunnable.js +++ b/js/grunt/buildRunnable.js @@ -35,6 +35,7 @@ const packageXHTML = require( './packageXHTML' ); const reportUnusedMedia = require( './reportUnusedMedia' ); const reportUnusedStrings = require( './reportUnusedStrings' ); const requireBuild = require( './requireBuild' ); +const zlib = require( 'zlib' ); /** * Builds a runnable (e.g. a simulation). @@ -185,13 +186,17 @@ module.exports = async function( repo, uglify, mangle, instrument, allHTML, bran includeAllLocales: true, isDebugBuild: false }, commonInitializationOptions ) ); - grunt.file.write( `${buildDir}/${repo}_all_${brand}.html`, packageRunnable( { + + const allHTMLFilename = `${buildDir}/${repo}_all_${brand}.html`; + const allHTMLContents = packageRunnable( { repo, stringMap, htmlHeader, locale: ChipperConstants.FALLBACK_LOCALE, scripts: [ initializationScript, splashScript, mipmapsJavaScript, ...productionPreloads, chipperStringsScript, productionJS ] - } ) ); + } ); + grunt.file.write( allHTMLFilename, allHTMLContents ); + grunt.file.write( `${allHTMLFilename}.gz`, zlib.gzipSync( allHTMLContents ) ); } // Debug build (always included)