Skip to content

Commit

Permalink
try/catch require of chokidar to make it truly optional
Browse files Browse the repository at this point in the history
closes #1072
  • Loading branch information
fdintino committed Feb 21, 2018
1 parent a65d3b8 commit 2c97201
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -4,6 +4,7 @@ Changelog
master (unreleased)
-------------------

* Fix regression to make `chokidar` an optional dependency again.

3.1.0 (Feb 19 2018)
-------------------
Expand Down
5 changes: 4 additions & 1 deletion nunjucks/src/node-loaders.js
Expand Up @@ -6,7 +6,10 @@ const fs = require('fs');
const path = require('path');
const Loader = require('./loader');
const {PrecompiledLoader} = require('./precompiled-loader.js');
const chokidar = require('chokidar');
let chokidar;
try {
chokidar = require('chokidar'); // eslint-disable-line global-require
} catch (e) {} // eslint-disable-line no-empty

class FileSystemLoader extends Loader {
constructor(searchPaths, opts) {
Expand Down

0 comments on commit 2c97201

Please sign in to comment.