From b5263494765251c029ecd81941d2aa7de3bb4350 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8B=BE=E4=B8=89=E8=82=A1=E5=9B=9B?= Date: Sat, 16 Dec 2017 00:51:34 +0800 Subject: [PATCH] fix: avoid hash collision in prod by including both filepath and content (#1086) --- lib/loader.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/loader.js b/lib/loader.js index f16e5a830..b33381757 100644 --- a/lib/loader.js +++ b/lib/loader.js @@ -82,7 +82,7 @@ module.exports = function (content) { process.cwd() const sourceRoot = path.dirname(path.relative(context, filePath)) const shortFilePath = path.relative(context, filePath).replace(/^(\.\.[\\\/])+/, '') - const moduleId = 'data-v-' + hash(isProduction ? content : shortFilePath) + const moduleId = 'data-v-' + hash(isProduction ? (shortFilePath + '\n' + content) : shortFilePath) let cssLoaderOptions = '' const cssSourceMap =