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:
vg-stan
2019-04-27 21:48:44 -04:00
committed by Ian Schmitz
parent e5f69b573b
commit c80e3feda7

View File

@@ -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