mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-03-25 17:55:04 +08:00
Change cssmodule classname hash to use repo relative paths (#6876)
* Change cssmodule classname hash to use repo relative paths instead of system absolute paths
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user