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' })}`] : []