From 84e72b2267711a2e849e6f3e3b1d0a51a951f459 Mon Sep 17 00:00:00 2001 From: Matt Pennington Date: Thu, 11 Apr 2019 15:07:45 -0600 Subject: [PATCH] #746 added gzip assets --- js/grunt/createHTMLFiles.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/js/grunt/createHTMLFiles.js b/js/grunt/createHTMLFiles.js index 7434789af..f0d2e0f6f 100644 --- a/js/grunt/createHTMLFiles.js +++ b/js/grunt/createHTMLFiles.js @@ -19,6 +19,7 @@ var getStringMap = require( '../../../chipper/js/grunt/getStringMap' ); var getThirdPartyLibEntries = require( '../../../chipper/js/grunt/getThirdPartyLibEntries' ); var ChipperConstants = require( '../../../chipper/js/common/ChipperConstants' ); var ChipperStringUtils = require( '../../../chipper/js/common/ChipperStringUtils' ); +var zlib = require( 'zlib' ); /** * @param grunt - the grunt instance @@ -263,7 +264,10 @@ module.exports = function( grunt, buildConfig, dependencies, mipmapsJavaScript, // Create an _all.html file if ( grunt.option( 'allHTML' ) && buildConfig.brand === 'phet' ) { - grunt.file.write( 'build/' + buildConfig.name + '_all.html', replaceLocaleConstants( html, 'en', true ) ); + var allHTMLFilename = 'build/' + buildConfig.name + '_all.html'; + var allHTMLContents = replaceLocaleConstants( html, 'en', true ); + grunt.file.write( allHTMLFilename, allHTMLContents ); + grunt.file.write( allHTMLFilename + '.gz', zlib.gzipSync( allHTMLContents ) ); } //TODO should this be using ChipperConstants.FALLBACK_LOCALE instead of hardcoded to 'en'?