NunjucksComponent: fix view loaders using cache when in dev env
This commit is contained in:
parent
7a4c157074
commit
c966536950
@ -32,15 +32,16 @@ export default class NunjucksComponent extends ApplicationComponent {
|
||||
log.warn('Couldn\'t determine coreVersion.', e);
|
||||
}
|
||||
|
||||
this.environment = new nunjucks.Environment([
|
||||
...this.viewsPath.map(path => new nunjucks.FileSystemLoader(path)),
|
||||
new nunjucks.FileSystemLoader(path.join(__dirname, '../../../views')),
|
||||
new nunjucks.FileSystemLoader(path.join(__dirname, '../views')),
|
||||
], {
|
||||
const opts = {
|
||||
autoescape: true,
|
||||
noCache: !config.get('view.cache'),
|
||||
throwOnUndefined: true,
|
||||
})
|
||||
};
|
||||
this.environment = new nunjucks.Environment([
|
||||
...this.viewsPath.map(path => new nunjucks.FileSystemLoader(path, opts)),
|
||||
new nunjucks.FileSystemLoader(path.join(__dirname, '../../../views'), opts),
|
||||
new nunjucks.FileSystemLoader(path.join(__dirname, '../views'), opts),
|
||||
], opts)
|
||||
.addGlobal('route', (
|
||||
route: string,
|
||||
params: RouteParams = [],
|
||||
|
Loading…
Reference in New Issue
Block a user