Merge pull request #4000 from overleaf/jpa-skip-pug-compile

[Server] optionally skip pre-compiling pug templates in production

GitOrigin-RevId: c50e6007dae3b0ab83a7edbce07a695a17e71404
This commit is contained in:
Jakob Ackermann 2021-05-06 13:16:34 +02:00 committed by Copybot
parent 46ecb39bdb
commit 8faae673b4
2 changed files with 2 additions and 1 deletions

View file

@ -242,7 +242,7 @@ if (Settings.enabledServices.includes('api')) {
if (Settings.enabledServices.includes('web')) {
logger.info('providing web router')
if (app.get('env') === 'production') {
if (Settings.precompilePugTemplatesAtBootTime) {
logger.info('precompiling views for web in production environment')
Views.precompileViews(app)
}

View file

@ -473,6 +473,7 @@ module.exports = settings =
# Production Settings
# -------------------
debugPugTemplates: process.env['DEBUG_PUG_TEMPLATES'] == 'true'
precompilePugTemplatesAtBootTime: if process.env['PRECOMPILE_PUG_TEMPLATES_AT_BOOT_TIME'] then process.env['PRECOMPILE_PUG_TEMPLATES_AT_BOOT_TIME'] == 'true' else process.env.NODE_ENV == 'production'
# Should javascript assets be served minified or not. Note that you will
# need to run `grunt compile:minify` within the web-sharelatex directory