From b9c5f9c04cec3431c333b0e8e49c08fb24d308f0 Mon Sep 17 00:00:00 2001 From: Alex Ting Date: Tue, 4 Oct 2022 16:55:16 -0700 Subject: [PATCH 1/3] fixed loading issue for sass files starting with _ --- heft-plugins/heft-sass-plugin/src/SassProcessor.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/heft-plugins/heft-sass-plugin/src/SassProcessor.ts b/heft-plugins/heft-sass-plugin/src/SassProcessor.ts index aed4d14e79e..80d7a1cdfbc 100644 --- a/heft-plugins/heft-sass-plugin/src/SassProcessor.ts +++ b/heft-plugins/heft-sass-plugin/src/SassProcessor.ts @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. +import * as path from 'path'; import { render, Result, SassError } from 'node-sass'; import * as postcss from 'postcss'; import cssModules from 'postcss-modules'; @@ -168,8 +169,7 @@ export class SassProcessor extends StringValuesTypingsGenerator { * Partial filenames always begin with a leading underscore and do not produce a CSS output file. */ private _isSassPartial(filePath: string): boolean { - const lastSlashIndex: number = filePath.lastIndexOf('/'); - return filePath.charAt(lastSlashIndex + 1) === '_'; + return path.basename(filePath)[0] === '_'; } private async _transpileSassAsync( From 2e42c49d299ef54541f664fbcfb9d429ace16e9f Mon Sep 17 00:00:00 2001 From: Alex Ting Date: Tue, 4 Oct 2022 17:02:41 -0700 Subject: [PATCH 2/3] mend --- ...tingmicrosoft-fix-scss-issues_2022-10-05-00-02.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 common/changes/@rushstack/heft-sass-plugin/atingmicrosoft-fix-scss-issues_2022-10-05-00-02.json diff --git a/common/changes/@rushstack/heft-sass-plugin/atingmicrosoft-fix-scss-issues_2022-10-05-00-02.json b/common/changes/@rushstack/heft-sass-plugin/atingmicrosoft-fix-scss-issues_2022-10-05-00-02.json new file mode 100644 index 00000000000..f78d1dcff87 --- /dev/null +++ b/common/changes/@rushstack/heft-sass-plugin/atingmicrosoft-fix-scss-issues_2022-10-05-00-02.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@rushstack/heft-sass-plugin", + "comment": "Reverted reverted _isSassPartial checker to previous version", + "type": "patch" + } + ], + "packageName": "@rushstack/heft-sass-plugin" +} \ No newline at end of file From 644999887585d7bda17c023f261aeef0dfa4bbd9 Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Tue, 4 Oct 2022 18:29:13 -0700 Subject: [PATCH 3/3] Update common/changes/@rushstack/heft-sass-plugin/atingmicrosoft-fix-scss-issues_2022-10-05-00-02.json --- .../atingmicrosoft-fix-scss-issues_2022-10-05-00-02.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/changes/@rushstack/heft-sass-plugin/atingmicrosoft-fix-scss-issues_2022-10-05-00-02.json b/common/changes/@rushstack/heft-sass-plugin/atingmicrosoft-fix-scss-issues_2022-10-05-00-02.json index f78d1dcff87..69b70bb6e63 100644 --- a/common/changes/@rushstack/heft-sass-plugin/atingmicrosoft-fix-scss-issues_2022-10-05-00-02.json +++ b/common/changes/@rushstack/heft-sass-plugin/atingmicrosoft-fix-scss-issues_2022-10-05-00-02.json @@ -2,7 +2,7 @@ "changes": [ { "packageName": "@rushstack/heft-sass-plugin", - "comment": "Reverted reverted _isSassPartial checker to previous version", + "comment": "Fix an issue with identifying partial sass files on Windows.", "type": "patch" } ],