Skip to content

Commit b526349

Browse files
Jinjiangyyx990803
authored andcommitted
fix: avoid hash collision in prod by including both filepath and content (#1086)
1 parent ecea3c3 commit b526349

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/loader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ module.exports = function (content) {
8282
process.cwd()
8383
const sourceRoot = path.dirname(path.relative(context, filePath))
8484
const shortFilePath = path.relative(context, filePath).replace(/^(\.\.[\\\/])+/, '')
85-
const moduleId = 'data-v-' + hash(isProduction ? content : shortFilePath)
85+
const moduleId = 'data-v-' + hash(isProduction ? (shortFilePath + '\n' + content) : shortFilePath)
8686

8787
let cssLoaderOptions = ''
8888
const cssSourceMap =

0 commit comments

Comments
 (0)