Skip to content

Commit adc6dd6

Browse files
WilsonLiu95haoqunjiang
authored andcommitted
fix: template comments replace windows \ to / confirm consistent hash (vuejs#1477)
1 parent 28ec37a commit adc6dd6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: lib/loaders/pitcher.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ module.exports.pitch = function (remainingRequest) {
112112
// For some reason, webpack fails to generate consistent hash if we
113113
// use absolute paths here, even though the path is only used in a
114114
// comment. For now we have to ensure cacheDirectory is a relative path.
115-
cacheDirectory: path.isAbsolute(cacheDirectory)
115+
cacheDirectory: (path.isAbsolute(cacheDirectory)
116116
? path.relative(process.cwd(), cacheDirectory)
117-
: cacheDirectory,
117+
: cacheDirectory).replace(/\\/g, '/'),
118118
cacheIdentifier: hash(cacheIdentifier) + '-vue-loader-template'
119119
})}`]
120120
: []

0 commit comments

Comments
 (0)