Skip to content

Commit

Permalink
make commit hash fetching work in production build
Browse files Browse the repository at this point in the history
  • Loading branch information
vikoivun committed Nov 28, 2017
1 parent f20bad5 commit d28249a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions config/webpack/prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ const common = {
}
}

const jsonConfigKeys = ["api_base", "local_storage_user_expiry_time", "nocache", "raven_id"];
const jsonConfigKeys = ["api_base", "local_storage_user_expiry_time", "nocache", "raven_id", "commit_hash"];
const templateConfigKeys = ["LE_PRODUCTION_INSTANCE", "APP_MODE"];

nconf.env(jsonConfigKeys.concat(templateConfigKeys));
nconf.defaults({
'LE_PRODUCTION_INSTANCE': '#',
'APP_MODE': 'production',
});
// 'memory' is needed to store the commit_hash
nconf.use('memory')
nconf.set('commit_hash', new GitRevisionPlugin.commithash());
nconf.required(jsonConfigKeys.concat(templateConfigKeys));

const gitRevisionPlugin = new GitRevisionPlugin();
nconf.set('commit_hash', gitRevisionPlugin.commithash());

const indexTemplate = jade.compileFile(path.join(common.paths.SRC, 'index.jade'), { pretty: true })

// We only want a subset of the read variables in configJson passed
Expand Down

0 comments on commit d28249a

Please sign in to comment.