From adc6dd6341998a4f2f98fb9a67bc85f98042d171 Mon Sep 17 00:00:00 2001 From: WilsonLiu95 Date: Thu, 24 Jan 2019 00:59:26 +0800 Subject: [PATCH] fix: template comments replace windows \ to / confirm consistent hash (#1477) --- lib/loaders/pitcher.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/loaders/pitcher.js b/lib/loaders/pitcher.js index 0bc770466..9609bd9e8 100644 --- a/lib/loaders/pitcher.js +++ b/lib/loaders/pitcher.js @@ -112,9 +112,9 @@ module.exports.pitch = function (remainingRequest) { // For some reason, webpack fails to generate consistent hash if we // use absolute paths here, even though the path is only used in a // comment. For now we have to ensure cacheDirectory is a relative path. - cacheDirectory: path.isAbsolute(cacheDirectory) + cacheDirectory: (path.isAbsolute(cacheDirectory) ? path.relative(process.cwd(), cacheDirectory) - : cacheDirectory, + : cacheDirectory).replace(/\\/g, '/'), cacheIdentifier: hash(cacheIdentifier) + '-vue-loader-template' })}`] : []