build file to base64,transform base64 file to Uint8Array.buffer in runtime
npm install binary-code-loader --save-dev
webpack.config.js
module.exports = {
module: {
rules: [
{
test: /\.wasm$/,
use: [
{
loader: 'binary-code-loader',
options: {
limit: 8192,
},
},
],
},
],
},
};
Name | Type | Default | Description |
---|---|---|---|
limit |
Boolean, Number, String | true | Specifying the maximum size of a file in bytes. |