From cb98ec35a64dd2078f6e273cd14c36f1c8ad82f7 Mon Sep 17 00:00:00 2001 From: sharkykh Date: Sat, 4 Aug 2018 15:32:07 +0300 Subject: [PATCH] Fix inconsistent hashes between Windows and POSIX systems --- 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