@rse/nunjucks-cli 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/nunjucks.js +8 -6
  2. package/package.json +1 -1
package/nunjucks.js CHANGED
@@ -139,12 +139,14 @@ const env = nunjucks.configure(inputFile, options)
139
139
  /* load external extension files */
140
140
  if (typeof argv.extension === "object" && argv.extension instanceof Array) {
141
141
  for (let extension of argv.extension) {
142
- let modpath = null
143
- try {
144
- modpath = require.resolve(extension)
145
- }
146
- catch (ex) {
147
- modpath = null
142
+ let modpath = path.resolve(extension)
143
+ if (!fs.existsSync(modpath)) {
144
+ try {
145
+ modpath = require.resolve(extension)
146
+ }
147
+ catch (ex) {
148
+ modpath = null
149
+ }
148
150
  }
149
151
  if (modpath === null) {
150
152
  console.error(chalk.red(`nunjucks: ERROR: failed to find extension module: ${extension}`))
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rse/nunjucks-cli",
3
3
  "publishConfig": { "access": "public" },
4
- "version": "1.3.0",
4
+ "version": "1.3.1",
5
5
  "description": "Nunjucks Template Rendering Command-Line Interface",
6
6
  "author": {
7
7
  "name": "Dr. Ralf S. Engelschall",