Skip to content

Commit 1c7d48f

Browse files
haoqunjiangmactanxin
authored andcommitted
fix: correctly calculate cacheIdentifier from lockfiles (vuejs#5113)
* fix: correctly calculate cacheIdentifier from lockfiles follow up of vuejs#3865 fixes vuejs#4438 * Revert "fix: correctly calculate cacheIdentifier from lockfiles" This reverts commit dbce88b. * fix: should take all configFiles and lockfiles into account The previous implementation is based on the assumption that config files have precendences, e.g. `.eslintrc.js` will take higher precendence over `.eslintrc`, and only one will take effect. This is not accurate however. For example, babel relies on both babel config and browserslist config, so we need to deal with 2 config files.
1 parent fe18236 commit 1c7d48f

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

packages/@vue/cli-service/lib/PluginAPI.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -199,13 +199,10 @@ class PluginAPI {
199199
}
200200
}
201201

202-
for (const file of configFiles) {
202+
variables.configFiles = configFiles.map(file => {
203203
const content = readConfig(file)
204-
if (content) {
205-
variables.configFiles = content.replace(/\r\n?/g, '\n')
206-
break
207-
}
208-
}
204+
return content && content.replace(/\r\n?/g, '\n')
205+
})
209206

210207
const cacheIdentifier = hash(variables)
211208
return { cacheDirectory, cacheIdentifier }

0 commit comments

Comments
 (0)