Skip to content

Commit

Permalink
Change cssmodule classname hash to use repo relative paths (#6876)
Browse files Browse the repository at this point in the history
* Change cssmodule classname hash to use repo relative paths instead of system absolute paths
  • Loading branch information
vg-stan authored and ianschmitz committed Apr 28, 2019
1 parent e5f69b5 commit c80e3fe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/react-dev-utils/getCSSModuleLocalIdent.js
Expand Up @@ -8,6 +8,7 @@
'use strict';

const loaderUtils = require('loader-utils');
const path = require('path');

module.exports = function getLocalIdent(
context,
Expand All @@ -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
Expand Down

0 comments on commit c80e3fe

Please sign in to comment.