Comparing version 4.0.1 to 4.1.0
4.1.0 / 2017-06-27 | ||
================== | ||
* feat: Make `viewExt` option support `include` directive (#38) | ||
* correct the demo in the Readme | ||
4.0.1 / 2017-06-25 | ||
@@ -3,0 +9,0 @@ ================== |
10
index.js
@@ -82,2 +82,12 @@ /*! | ||
const tpl = await fs.readFile(viewPath, 'utf8'); | ||
// override `ejs` node_module `resolveInclude` function | ||
const parentResolveInclude = ejs.resolveInclude; | ||
ejs.resolveInclude = function(name, filename, isDir) { | ||
if (!path.extname(name)) { | ||
name += settings.viewExt; | ||
} | ||
return parentResolveInclude(name, filename, isDir); | ||
} | ||
const fn = ejs.compile(tpl, { | ||
@@ -84,0 +94,0 @@ filename: viewPath, |
{ | ||
"name": "koa-ejs", | ||
"version": "4.0.1", | ||
"version": "4.1.0", | ||
"description": "ejs render middleware for koa", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -17,2 +17,3 @@ koa-ejs | ||
const render = require('koa-ejs'); | ||
const path = require('path'); | ||
@@ -19,0 +20,0 @@ const app = new Koa(); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9536
113
87