A craco
plugin to add support for WASM
modules to CRA apps.
yarn add craco-wasm
In craco.config.js
const cracoWasm = require("craco-wasm")
module.exports = {
plugins: [cracoWasm()]
}
create-react-app
is based on Webpack 5, which has experimental support for
WASM modules. In order to enable this support this plugin does two things:
- Enable the
experiments.asyncWebAssembly
webpack config - Add
/\.wasm$/
to the list of files which are not processed by the file-loader in the CRA webpack config