How to configure configure of nunjucks template under egg-view

recently, when using the template engine under eggjs, you need to use the ctx.renderView method to return the content in the template, but it is found that the returned content will have blank lines and spaces, because there is a site after the template language has been replaced. Look up the nunjucks document
and find

clipboard.png

can actually be set, and I have tested some of them according to nunjucks alone. But I don"t know how to set these parameters in eggjs

look forward to God"s guidance

May.14,2022

this is plugin file

// plugin.js
exports.nunjucks = {
  enable: true,
  package: 'egg-view-nunjucks',
};

all plugin's configure can defined in config file

// config.default.js
exports.nunjucks = {
  autoescape: false
}
Menu