Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change cssmodule classname hash to use repo relative paths instead of… #6876

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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