diff --git a/lib/plugins/helper/fragment_cache.js b/lib/plugins/helper/fragment_cache.js index b54468b372..6510b8de7b 100644 --- a/lib/plugins/helper/fragment_cache.js +++ b/lib/plugins/helper/fragment_cache.js @@ -3,10 +3,8 @@ module.exports = ctx => { let cache = {}; - ctx.on('generateBefore', function() { - // reset cache for watch mode - cache = {}; - }); + // reset cache for watch mode + ctx.on('generateBefore', () => { cache = {}; }); return function fragmentCache(id, fn) { if (this.cache && cache[id] != null) return cache[id];