Skip to content

webpack: Restore child compiler assets from persistent cache - #1822

Merged
askoufis merged 1 commit into
masterfrom
fix-webpack-child-asset-caching
Nov 25, 2026
Merged

askoufis merged 1 commit into
masterfrom
fix-webpack-child-asset-caching

Conversation

@askoufis

Copy link
Copy Markdown
Contributor

Assets emitted by the child compiler (e.g. fonts from asset/resource modules) were only added to the parent compilation via runAsChild, so they were lost when the .css.ts module was restored from webpack's persistent cache. Re-emit them through the loader so they're attached to the parent module's buildInfo.

Also drop assets emitted by plugins inherited from the parent compiler, such as Next.js' middleware-manifest.json and .nft.json files, which caused Multiple assets emit different content conflicts.

Fixes #1123. Fixes #1554.

Assets emitted by the child compiler (e.g. fonts from asset/resource
modules) were only added to the parent compilation via `runAsChild`, so
they were lost when the `.css.ts` module was restored from webpack's
persistent cache. Re-emit them through the loader so they're attached
to the parent module's `buildInfo`.

Also drop assets emitted by plugins inherited from the parent compiler,
such as Next.js' `middleware-manifest.json` and `.nft.json` files, which
caused `Multiple assets emit different content` conflicts.

Fixes #1123. Fixes #1554.
@changeset-bot

changeset-bot Bot commented Nov 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 086dad7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@vanilla-extract/webpack-plugin Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@askoufis
askoufis merged commit 93fb621 into master Nov 25, 2026
7 checks passed
@askoufis
askoufis deleted the fix-webpack-child-asset-caching branch November 25, 2026 10:52
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.

NextJS 15.2 build issues ("Multiple assets emit"). Next.js integration caching breaks with custom webpack loader rules

1 participant