Skip to content

Commit c80e3fe

Browse files
vg-stanianschmitz
authored andcommitted
Change cssmodule classname hash to use repo relative paths (#6876)
* Change cssmodule classname hash to use repo relative paths instead of system absolute paths
1 parent e5f69b5 commit c80e3fe

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: packages/react-dev-utils/getCSSModuleLocalIdent.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
'use strict';
99

1010
const loaderUtils = require('loader-utils');
11+
const path = require('path');
1112

1213
module.exports = function getLocalIdent(
1314
context,
@@ -23,7 +24,7 @@ module.exports = function getLocalIdent(
2324
: '[name]';
2425
// Create a hash based on a the file location and class name. Will be unique across a project, and close to globally unique.
2526
const hash = loaderUtils.getHashDigest(
26-
context.resourcePath + localName,
27+
path.posix.relative(context.rootContext, context.resourcePath) + localName,
2728
'md5',
2829
'base64',
2930
5

0 commit comments

Comments
 (0)