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)