Skip to content

Commit 77588c2

Browse files
authored
docs(README): add about .wasm file
1 parent 151a5e6 commit 77588c2

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

README.md

+16-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ If you read only the specific extensions (e.g. wasm), please add loader in `webp
3737
module: {
3838
loaders: [
3939
{
40-
test: /\.wasm$/,
40+
test: /\.png$/,
4141
loaders: ['arraybuffer-loader'],
4242
},
4343
],
@@ -53,6 +53,21 @@ const array = new Uint8Array(buffer)
5353

5454
See also offical document [Loaders](https://webpack.js.org/concepts/loaders/).
5555

56+
### For `.wasm` file
57+
Webpack 4 or later has embedded WASM parser. So, please set `type: 'javascript/auto'` when use `arraybuffer-loader`.
58+
59+
```js
60+
module: {
61+
loaders: [
62+
{
63+
test: /\.wasm$/,
64+
type: 'javascript/auto',
65+
loaders: ['arraybuffer-loader'],
66+
},
67+
],
68+
},
69+
```
70+
5671
## License
5772
MIT © Pine Mizune
5873

0 commit comments

Comments
 (0)