Skip to content

Instantly share code, notes, and snippets.

@BCsabaEngine
Last active October 8, 2020 10:21
Show Gist options
  • Save BCsabaEngine/59eb7cd5ba65ef303bf32445647ff018 to your computer and use it in GitHub Desktop.
Save BCsabaEngine/59eb7cd5ba65ef303bf32445647ff018 to your computer and use it in GitHub Desktop.
PUG/JADE allow cache when production
const isproduction = (process.env.NODE_ENV === 'production');
const origrenderfile = pug.renderFile;
pug.renderFile = (path, options, fn) => {
options.cache = isproduction;
return origrenderfile(path, options, fn);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment