diff --git a/services/web/app/src/infrastructure/Views.js b/services/web/app/src/infrastructure/Views.js index f3c250bcf7..e39ec1d282 100644 --- a/services/web/app/src/infrastructure/Views.js +++ b/services/web/app/src/infrastructure/Views.js @@ -5,12 +5,18 @@ const globby = require('globby') // Generate list of view names from app/views const viewList = globby - .sync('**/*.pug', { + .sync('app/views/**/*.pug', { onlyFiles: true, concurrency: 1, - ignore: '**/_*.pug', - cwd: 'app/views' + ignore: '**/_*.pug' }) + .concat( + globby.sync('modules/*/app/views/**/*.pug', { + onlyFiles: true, + concurrency: 1, + ignore: '**/_*.pug' + }) + ) .map(x => { return x.replace(/\.pug$/, '') // strip trailing .pug extension }) @@ -25,7 +31,7 @@ module.exports = { let failures = 0 viewList.forEach(view => { try { - let filename = app.get('views') + '/' + view + '.pug' + let filename = view + '.pug' pug.compileFile(filename, { cache: true }) logger.log({ view }, 'compiled') success++