Skip to content

Commit

Permalink
Merge pull request #3673 from atingmicrosoft/atingmicrosoft/fix-scss-…
Browse files Browse the repository at this point in the history
…issues

[heft-sass-plugin] Fix identification of SASS partials on Windows
  • Loading branch information
iclanton authored Oct 5, 2022
2 parents 4f0ce88 + 6449998 commit 9e51c05
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@rushstack/heft-sass-plugin",
"comment": "Fix an issue with identifying partial sass files on Windows.",
"type": "patch"
}
],
"packageName": "@rushstack/heft-sass-plugin"
}
4 changes: 2 additions & 2 deletions heft-plugins/heft-sass-plugin/src/SassProcessor.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 9e51c05

Please sign in to comment.