Skip to content

fix: track sync-loaded files as webpack dependencies#596

Merged
alexander-akait merged 2 commits into
mainfrom
claude/investigate-issue-492-gspaj
May 20, 2026
Merged

fix: track sync-loaded files as webpack dependencies#596
alexander-akait merged 2 commits into
mainfrom
claude/investigate-issue-492-gspaj

Conversation

@alexander-akait
Copy link
Copy Markdown
Member

Less's data-uri() built-in and any custom Less function (including
those installed via @plugin) load files synchronously. Webpack no
longer exposes a sync resolver, so the file manager previously signalled
supportsSync: false and let Less's default file manager handle the
sync read - meaning those files were never added to webpack's file
dependency set. With persistent caching enabled, changes to a file used
only via data-uri() would not invalidate the cached bundle.

The file manager now fulfils sync reads itself (delegating the actual
read to the parent class's loadFile with syncImport: true), records
the resolved filename as a dependency, and kicks off an async webpack
resolve in parallel so aliased / webpack-only resolutions also feed into
the dependency set. The loader awaits these tasks before completing.

Closes #492

@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented May 20, 2026

CLA Not Signed

Less's `data-uri()` built-in and any custom Less function (including
those installed via `@plugin`) load files synchronously. Webpack no
longer exposes a sync resolver, so the file manager previously signalled
`supportsSync: false` and let Less's default file manager handle the
sync read - meaning those files were never added to webpack's file
dependency set. With persistent caching enabled, changes to a file used
only via `data-uri()` would not invalidate the cached bundle.

The file manager now fulfils sync reads itself (delegating the actual
read to the parent class's `loadFile` with `syncImport: true`), records
the resolved filename as a dependency, and kicks off an async webpack
resolve in parallel so aliased / webpack-only resolutions also feed into
the dependency set. The loader awaits these tasks before completing.

Closes #492
@alexander-akait alexander-akait force-pushed the claude/investigate-issue-492-gspaj branch from 8966287 to 2c30390 Compare May 20, 2026 13:15
@codecov
Copy link
Copy Markdown

codecov Bot commented May 20, 2026

Codecov Report

❌ Patch coverage is 95.87629% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.72%. Comparing base (e112e32) to head (50254df).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/utils.js 95.23% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #596      +/-   ##
==========================================
- Coverage   96.94%   96.72%   -0.22%     
==========================================
  Files           2        2              
  Lines         556      642      +86     
==========================================
+ Hits          539      621      +82     
- Misses         17       21       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@alexander-akait alexander-akait merged commit 44fb40d into main May 20, 2026
11 of 14 checks passed
@alexander-akait alexander-akait deleted the claude/investigate-issue-492-gspaj branch May 20, 2026 13:25
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.

Attempt to track cache dependencies for synchronous loaded resources

2 participants