From cf8b6e86b2306508992b337b09ae87845064988c Mon Sep 17 00:00:00 2001 From: sharkykh Date: Tue, 14 Aug 2018 00:03:35 +0300 Subject: [PATCH] fix: fix inconsistent hashes between Windows and POSIX systems (#28) --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 447bce42..4adcd219 100644 --- a/index.js +++ b/index.js @@ -18,7 +18,8 @@ module.exports.pitch = function (remainingRequest) { var addStylesShadowPath = loaderUtils.stringifyRequest(this, '!' + path.join(__dirname, 'lib/addStylesShadow.js')) var request = loaderUtils.stringifyRequest(this, '!!' + remainingRequest) - var id = JSON.stringify(hash(request + path.relative(__dirname, this.resourcePath))) + var relPath = path.relative(__dirname, this.resourcePath).replace(/\\/g, '/') + var id = JSON.stringify(hash(request + relPath)) var options = loaderUtils.getOptions(this) || {} // direct css import from js --> direct, or manually call `styles.__inject__(ssrContext)` with `manualInject` option