Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[heft-sass-plugin] Fix identification of SASS partials on Windows #3673

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@rushstack/heft-sass-plugin",
"comment": "Reverted reverted _isSassPartial checker to previous version",
iclanton marked this conversation as resolved.
Show resolved Hide resolved
"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