You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/blog/2026-04-13-webpack-5-106.mdx
+34-1Lines changed: 34 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,13 +5,14 @@ contributors:
5
5
- bjohansebas
6
6
---
7
7
8
-
**Webpack 5.106 introduces plugin validation hooks, built-in runtime style injection for CSS Modules, smarter tree shaking for CommonJS destructuring, and an experimental integration with `oxc-parser` for faster JavaScript parsing.**
8
+
**Webpack 5.106 introduces plugin validation hooks, built-in runtime style injection for CSS Modules, smarter tree shaking for CommonJS destructuring, source-phase imports for WebAssembly modules, and an experimental integration with `oxc-parser` for faster JavaScript parsing.**
9
9
10
10
Explore what's new in this release:
11
11
12
12
-[**Plugin Validation with `compiler.hooks.validate`**](#plugin-validation-with-compilerhooksvalidate)
13
13
-[**CSS Modules with Runtime Style Injection**](#css-modules-with-runtime-style-injection)
14
14
-[**Better Tree Shaking for CommonJS Destructuring**](#better-tree-shaking-for-commonjs-destructuring)
15
+
-[**Source Phase Imports for WebAssembly (Experimental)**](#source-phase-imports-for-webassembly-experimental)
15
16
-[**Getting Started with `create-webpack-app`**](#getting-started-with-create-webpack-app)
16
17
-[**Context Support for VirtualUrlPlugin**](#context-support-for-virtualurlplugin)
17
18
-[**Experimental JavaScript Parsing with `oxc-parser`**](#experimental-javascript-parsing-with-oxc-parser)
@@ -141,6 +142,38 @@ This also works with `module.require`:
141
142
const { a, b } =module.require("./module");
142
143
```
143
144
145
+
## Source Phase Imports for WebAssembly (Experimental)
146
+
147
+
Webpack now includes experimental support for TC39 [Source Phase Imports](https://github.com/tc39/proposal-source-phase-imports) when importing WebAssembly modules.
148
+
149
+
The proposal is currently at **Stage 3** and introduces a way to import a module at the _source phase_ instead of immediately evaluating it. In practical terms for WebAssembly, this means you can obtain a compiled `WebAssembly.Module` first, and instantiate it later with your own imports.
150
+
151
+
Enable the feature with `experiments.sourceImport`:
152
+
153
+
```js
154
+
module.exports= {
155
+
experiments: {
156
+
asyncWebAssembly:true,
157
+
sourceImport:true,
158
+
},
159
+
};
160
+
```
161
+
162
+
Then use either static or dynamic source-phase syntax:
[`create-webpack-app`](https://www.npmjs.com/package/create-webpack-app) is now the recommended way to scaffold a new webpack project. Previously, this functionality lived inside `webpack-cli` as the `webpack init` command, but it has been extracted into its own standalone package with the release of webpack-cli 7.
0 commit comments