Skip to content

Commit 476e7fd

Browse files
mizzaoGuillaume Chau
authored andcommitted
Add file name/path to caching compiler. Fixes #258 (#278)
1 parent 8ac1ea2 commit 476e7fd

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

packages/vue-component/plugin/vue-compiler.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,11 @@ VueComponentCompiler = class VueCompo extends CachingCompiler {
126126

127127
getCacheKey(inputFile) {
128128
let cache = Cache.getCache(inputFile)
129-
return inputFile.getSourceHash() + '_' + cache.dependencyManager.lastChangeTime
129+
return [
130+
inputFile.getSourceHash(),
131+
inputFile.getPathInPackage(),
132+
cache.dependencyManager.lastChangeTime
133+
]
130134
}
131135

132136
compileResultSize(compileResult) {

packages/vue-router/plugin/plugin.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ class VueRouterCompiler extends CachingCompiler {
1414
}
1515

1616
getCacheKey(inputFile) {
17-
return inputFile.getSourceHash();
17+
return [
18+
inputFile.getSourceHash(),
19+
inputFile.getPathInPackage()
20+
];
1821
}
1922

2023
compileResultSize(compileResult) {

packages/vue-router2/plugin/plugin.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ class VueRouterCompiler extends CachingCompiler {
1313
}
1414

1515
getCacheKey (inputFile) {
16-
return inputFile.getSourceHash()
16+
return [
17+
inputFile.getSourceHash(),
18+
inputFile.getPathInPackage()
19+
]
1720
}
1821

1922
compileResultSize (compileResult) {

0 commit comments

Comments
 (0)