diff --git a/packages/react-dev-utils/getCSSModuleLocalIdent.js b/packages/react-dev-utils/getCSSModuleLocalIdent.js index 504bb1581e1..1b1ecf7695b 100644 --- a/packages/react-dev-utils/getCSSModuleLocalIdent.js +++ b/packages/react-dev-utils/getCSSModuleLocalIdent.js @@ -8,6 +8,7 @@ 'use strict'; const loaderUtils = require('loader-utils'); +const path = require('path'); module.exports = function getLocalIdent( context, @@ -23,7 +24,7 @@ module.exports = function getLocalIdent( : '[name]'; // Create a hash based on a the file location and class name. Will be unique across a project, and close to globally unique. const hash = loaderUtils.getHashDigest( - context.resourcePath + localName, + path.posix.relative(context.rootContext, context.resourcePath) + localName, 'md5', 'base64', 5