diff --git a/js/grunt/buildRunnable.js b/js/grunt/buildRunnable.js index 9473fbe6b..47e2e9c4c 100644 --- a/js/grunt/buildRunnable.js +++ b/js/grunt/buildRunnable.js @@ -37,6 +37,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). @@ -187,13 +188,17 @@ module.exports = async function( repo, minifyOptions, instrument, allHTML, brand 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: repo, stringMap: stringMap, htmlHeader: 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)