How to use the invalidateCache function from swig

Find comprehensive JavaScript swig.invalidateCache code examples handpicked from public code repositorys.

40
41
42
43
44
45
46
47
48
49

/*
var watch = require('watch')
watch.createMonitor(__dirname + '/views', function(monitor) {
  monitor.on("changed", function(file) {
    swig.invalidateCache();
    ejs.clearCache();
    jade.cache = {};
    hbs.cache = {};
  });
fork icon11
star icon28
watch icon3

+ 3 other calls in file

3481
3482
3483
3484
3485
3486
3487
3488
3489
3490

/**
 * Clears the in-memory template cache.
 *
 * @example
 * swig.invalidateCache();
 *
 * @return {undefined}
 */
this.invalidateCache = function () {
fork icon0
star icon1
watch icon0

99
100
101
102
103
104
105
106
107
108
var swig = require('swig');
var metalfile = require('./metalfile.js');
var Metalsmith = require('metalsmith');

gulp.task('pages', function(done) {
  swig.invalidateCache()

  var m = new Metalsmith(__dirname)
    .clean(false)
    .source('source/templates')
fork icon0
star icon1
watch icon1