Skip to content

Write the .map file in File sourcemap mode - #280

Merged
shadoath merged 1 commit into
masterfrom
fix/sourcemap-file-mode
Nov 3, 2026
Merged

shadoath merged 1 commit into
masterfrom
fix/sourcemap-file-mode

Conversation

@shadoath

@shadoath shadoath commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Done when: with Source Map Mode set to "File", compiling style.scss writes css/style.css.map next to style.css and the map loads over HTTP. Checked in Docker (WP 7.1.4, PHP 8.4): on master the CSS ends with /*# sourceMappingURL=style.css.map */ but the file is never written; on this branch it's written with the right sources.
  • Fixes Map file not generated #207: File mode broke when the plugin moved to compileString(). scssphp 1.x returns the map through CompilationResult::getSourceMap() and ignores the sourceMapWriteTo option. The map is now written to the cache folder next to the CSS and moved into the CSS folder with it, so it shares the existing all-files-compiled-or-none-published rule. The dead sourceMapWriteTo option is gone.
  • How this could fail: turning File mode off leaves the old .map files in the CSS folder. The CSS no longer points at them, so browsers ignore them, but anyone who opens the folder sees stale files. Harmless, and nothing tells you about them.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@shadoath

shadoath commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@shadoath
shadoath merged commit ec6c8a4 into master Nov 3, 2026
@shadoath
shadoath deleted the fix/sourcemap-file-mode branch November 3, 2026 02:50
@shadoath shadoath mentioned this pull request Nov 3, 2026
shadoath added a commit that referenced this pull request Nov 3, 2026
* Version bump to 5.1.0

Ships the Compile Now button and deploy webhook (#281), the WP_SCSS_OPTIONS wp-config override (#282), the File sourcemap fix (#280) and the unreadable-directory fatal fix (#279). Updates the version in wp-scss.php, the readme.txt Stable tag, and adds the 5.1.0 changelog entry to readme.txt and readme.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Remove the looking-for-a-maintainer notice from both readmes

Issue #242 is closed; the plugin is actively maintained again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Map file not generated

1 participant