Skip to content

Commit 2a08085

Browse files
author
Thomas Wang
committed
Use smaller cacheKey
The whole file content string of template compiler is ~700kb, full path should be enough for cacheKey
1 parent 4662c0a commit 2a08085

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

lib/utils.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
'use strict';
22

3-
const fs = require('fs');
43
const path = require('path');
54
const hashForDep = require('hash-for-dep');
65
const debugGenerator = require('heimdalljs-logger');
@@ -207,8 +206,7 @@ function setup(pluginInfo, options) {
207206

208207
function makeCacheKey(templateCompilerPath, pluginInfo, extra) {
209208
let templateCompilerFullPath = require.resolve(templateCompilerPath);
210-
let templateCompilerCacheKey = fs.readFileSync(templateCompilerFullPath, { encoding: 'utf-8' });
211-
let cacheItems = [templateCompilerCacheKey, extra].concat(pluginInfo.cacheKeys.sort());
209+
let cacheItems = [templateCompilerFullPath, extra].concat(pluginInfo.cacheKeys.sort());
212210
// extra may be undefined
213211
return cacheItems.filter(Boolean).join('|');
214212
}

0 commit comments

Comments
 (0)