Skip to content
关注公众号,获取新课通知

模板引擎


安装

shell
npm i egg-view-nunjucks --save

文档

https://nunjucks.bootcss.com/templating.html

配置插件

js
// {app_root}/config/plugin.js
nunjucks: {
    enable: true,
    package: 'egg-view-nunjucks',
},
  • config/config.default.js 目录下配置
js
config.view = {
  mapping: {
    ".html": "nunjucks",
  },
};