Skip to content

blog: webpack 5.108#8277

Merged
bjohansebas merged 10 commits into
mainfrom
blog-webpack-5-108
Jun 25, 2026
Merged

blog: webpack 5.108#8277
bjohansebas merged 10 commits into
mainfrom
blog-webpack-5-108

Conversation

@bjohansebas

Copy link
Copy Markdown
Member

Summary

webpack/webpack#21037

What kind of change does this PR introduce?

Did you add tests for your changes?

Does this PR introduce a breaking change?

If relevant, what needs to be documented once your changes are merged or what have you already documented?

Use of AI

Copilot AI review requested due to automatic review settings June 18, 2026 17:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@vercel

vercel Bot commented Jun 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
webpack-js-org Ready Ready Preview, Comment Jun 25, 2026 5:12pm

Request Review


### `url()` Inside HTML `style` Attributes

Webpack can now route an HTML inline `style="..."` attribute through the CSS pipeline, resolving `url()`, `image-set()`, and `@import` relative to the HTML file. This is powered by a new [`module.parser.css.as`](/configuration/module/#moduleparsercssas) option that selects the top-level CSS production to parse: `"stylesheet"` (the default, a full stylesheet) or `"block-contents"` (a declaration list, like the inside of a `style` attribute).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't have @import inside style tag, we resolve all function which can have URLs

Comment thread src/content/blog/2026-06-18-webpack-5-108.mdx Outdated

For the new `universal` target (below), CSS now runs in Node without crashing and exposes styles for server-side rendering. Styles from `style` injection and `link`-loaded chunks are collected into a registry an SSR host can read at `globalThis["__webpack_css__" + output.uniqueName]`. Single-platform (web-only or node-only) builds emit no extra runtime, so this is scoped entirely to universal output.

## The `universal` Target

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add more description and cases here, it is a great feature (also some limitations too)

Copilot AI review requested due to automatic review settings June 23, 2026 19:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings June 25, 2026 17:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@bjohansebas bjohansebas merged commit a58baad into main Jun 25, 2026
9 checks passed
@bjohansebas bjohansebas deleted the blog-webpack-5-108 branch June 25, 2026 17:21
};
```

To make this feel like Vite or Parcel, webpack 5.108 also adds `.html` (and `.css`, when [`experiments.css`](/configuration/experiments/#experimentscss) is enabled) to the default `resolve.extensions`, ahead of the JavaScript extensions. With the HTML experiment on, the default `./src` entry therefore resolves `./src/index.html` over `./src/index.js`:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also adds .html (and .css, when experiments.css is enabled) to the default resolve.extensions, ahead of the JavaScript extensions.

Should it be clarified that .html is added before JS extensions and .css after them as per defaults.js?

};
```

### `[uniquename]` Template Placeholder

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be beneficial to adopt the same convention as per TemplatedPathPlugin.js#L669-L670 and the output docs, which both treat [uniqueName] as canonical and [uniquename] as the alias?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants