[heft-sass-plugin] Add doNotTrimOriginalFileExtension option#5755
Open
iclanton wants to merge 6 commits intomicrosoft:mainfrom
Open
[heft-sass-plugin] Add doNotTrimOriginalFileExtension option#5755iclanton wants to merge 6 commits intomicrosoft:mainfrom
iclanton wants to merge 6 commits intomicrosoft:mainfrom
Conversation
- Add the option to the JSON schema and sass.json template - Wire it through SassPlugin's ISassConfigurationJson and sassProcessorOptions - Add heft-sass-doNotTrimOriginalFileExtension-test build-test project to verify CSS output files retain the original extension (e.g. styles.module.scss.css) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
dmichon-msft
approved these changes
Apr 8, 2026
bmiddha
approved these changes
Apr 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
doNotTrimOriginalFileExtensionoption toheft-sass-plugin. When enabled, the original source file extension is preserved in the CSS output filename. For example,styles.scssemitsstyles.scss.cssinstead ofstyles.css.Details
Previously, the plugin always stripped the original extension before appending
.css, sostyles.module.scsswould producestyles.module.css. Some consumers need the original extension retained in the output path (e.g. to avoid filename collisions when multiple input extensions map to the same base name, or to match an expected import path convention).The option is wired through
ISassConfigurationJsoninSassPlugin.ts→ISassProcessorOptionsinSassProcessor.ts, where the branching logic in CSS output path generation was already added.A new build-test project (
heft-sass-doNotTrimOriginalFileExtension-test) exercises the option end-to-end: it configuresdoNotTrimOriginalFileExtension: trueand uses Jest snapshot tests to assert that the CSS output files carry the original extension (e.g.styles.module.scss.css,stylesGlobal.global.scss.css).How it was tested
The new
heft-sass-doNotTrimOriginalFileExtension-testbuild-test project will be built as part of CI. Snapshots will be committed after the initial build to lock in the expected output filenames.