Skip to content

Commit

Permalink
#746 added gzip assets
Browse files Browse the repository at this point in the history
  • Loading branch information
mattpen committed Apr 26, 2019
1 parent 802039c commit 1b2b69d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions js/grunt/buildRunnable.js
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 1b2b69d

Please sign in to comment.