File tree Expand file tree Collapse file tree
core-build/gulp-core-build-sass/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,8 +28,10 @@ export default class CSSModules implements ICSSModules {
2828 /**
2929 * CSSModules includes the source file's path relative to the project root
3030 * as part of the class name hashing algorithm.
31- * This should be configured with `buildConfig.rootPath` for SassTask, but
32- * will default the process' current working dir.
31+ * This should be configured with the setting:
32+ * {@link @microsoft/gulp-core-build#IBuildConfig.rootPath }
33+ * That is used in {@link ./SassTask#SassTask}
34+ * But will default the process' current working dir.
3335 */
3436 constructor ( rootPath ?: string ) {
3537 this . _classMap = { } ;
@@ -58,7 +60,8 @@ export default class CSSModules implements ICSSModules {
5860 protected generateScopedName ( name : string , fileName : string , css : string )
5961 : string {
6062 const fileBaseName : string = path . relative ( this . _rootPath , fileName ) ;
61- const hash : string = crypto . createHmac ( 'sha1' , fileBaseName )
63+ const safeFileBaseName : string = fileBaseName . replace ( / \\ / g, '/' ) ;
64+ const hash : string = crypto . createHmac ( 'sha1' , safeFileBaseName )
6265 . update ( css )
6366 . digest ( 'hex' )
6467 . substring ( 0 , 8 ) ;
You can’t perform that action at this time.
0 commit comments