Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
Update njk-loader options
Browse files Browse the repository at this point in the history
  • Loading branch information
alsolovyev committed Apr 23, 2021
1 parent 0ba9b41 commit e26b808
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion config/loaders/nunjucks.loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ const htmlLoader = {
const nunjucksLoader = {
loader: path.resolve('./config/modules/njk-loader'),
options: {
context: require(path.resolve(SOURCE_DIR, 'data', 'nunjucks.data.js')),
autoescape: false,
context: path.resolve(SOURCE_DIR, 'data/nunjucks.data.js'),
templates: 'njk'
}
}
Expand Down
4 changes: 2 additions & 2 deletions config/modules/njk-loader/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ module.exports = function(source) {
const { context, templates } = this.getOptions(schema)

const env = new Environment(
new FileSystemLoader(path.resolve(this.rootContext, templates)),
new FileSystemLoader(path.resolve(this.rootContext, templates || '')),
{
autoescape: true
autoescape: autoescape || true
}
)
env.on('load', (name, source, loader) => {
Expand Down

0 comments on commit e26b808

Please sign in to comment.