Skip to content

Commit 09994d9

Browse files
authored
docs(config) : Add enabledWasmLoadingTypes and wasmLoading for output (webpack#3983)
1 parent 213bd5a commit 09994d9

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

src/content/configuration/output.md

+35
Original file line numberDiff line numberDiff line change
@@ -1201,6 +1201,41 @@ module.exports = {
12011201
};
12021202
```
12031203

1204+
## `output.wasmLoading`
1205+
1206+
`boolean = false` `string`
1207+
1208+
Option to set the method of loading WebAssembly Modules. Methods included by default are `'fetch'` (web/WebWorker), `'async-node'` (Node.js), but others might be added by plugins.
1209+
1210+
The default value can be affected by different [`target`](/configuration/target/):
1211+
1212+
- Defaults to `'fetch'` if [`target`](/configuration/target/) is set to `'web'`, `'webworker'`, `'electron-renderer'` or `'node-webkit'`.
1213+
- Defaults to `'async-node'` if [`target`](/configuration/target/) is set to `'node'`, `'async-node'`, `'electron-main'` or `'electron-preload'`.
1214+
1215+
```javascript
1216+
module.exports = {
1217+
//...
1218+
output: {
1219+
wasmLoading: 'fetch'
1220+
}
1221+
};
1222+
```
1223+
1224+
## `output.enabledWasmLoadingTypes`
1225+
1226+
`[string]`
1227+
1228+
List of wasm loading types enabled for use by entry points.
1229+
1230+
```javascript
1231+
module.exports = {
1232+
//...
1233+
output: {
1234+
enabledWasmLoadingTypes: ['fetch']
1235+
}
1236+
};
1237+
```
1238+
12041239
## `output.iife`
12051240

12061241
`boolean = true`

0 commit comments

Comments
 (0)