Skip to content

Commit

Permalink
Merge pull request elastic#7551 from spalger/fix/invalidBundlesBuild
Browse files Browse the repository at this point in the history
[optimizer] rebuild all bundles when any are invalid
  • Loading branch information
spalger authored Jun 28, 2016
2 parents 007606e + 1dba2ad commit 143e733
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/optimize/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,11 @@ module.exports = async (kbnServer, server, config) => {
server.exposeStaticDir('/bundles/{path*}', bundles.env.workingDir);
await bundles.writeEntryFiles();

// in prod, only bundle what looks invalid or missing
if (config.get('optimize.useBundleCache')) {
bundles = await bundles.getInvalidBundles();
}
// in prod, only bundle when someing is missing or invalid
let invalidBundles = config.get('optimize.useBundleCache') ? await bundles.getInvalidBundles() : bundles;

// we might not have any work to do
if (!bundles.getIds().length) {
if (!invalidBundles.getIds().length) {
server.log(
['debug', 'optimize'],
`All bundles are cached and ready to go!`
Expand Down

0 comments on commit 143e733

Please sign in to comment.