Skip to content

Commit cf8b6e8

Browse files
sharkykhyyx990803
authored andcommitted
fix: fix inconsistent hashes between Windows and POSIX systems (#28)
1 parent 7672c18 commit cf8b6e8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ module.exports.pitch = function (remainingRequest) {
1818
var addStylesShadowPath = loaderUtils.stringifyRequest(this, '!' + path.join(__dirname, 'lib/addStylesShadow.js'))
1919

2020
var request = loaderUtils.stringifyRequest(this, '!!' + remainingRequest)
21-
var id = JSON.stringify(hash(request + path.relative(__dirname, this.resourcePath)))
21+
var relPath = path.relative(__dirname, this.resourcePath).replace(/\\/g, '/')
22+
var id = JSON.stringify(hash(request + relPath))
2223
var options = loaderUtils.getOptions(this) || {}
2324

2425
// direct css import from js --> direct, or manually call `styles.__inject__(ssrContext)` with `manualInject` option

0 commit comments

Comments
 (0)