-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
19 lines (18 loc) · 918 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
module.exports = function() {
return {
plugin: {
overrideWebpackConfig: ({webpackConfig}) => {
webpackConfig.experiments = { asyncWebAssembly: true }
// The last rule in the react-scripts webpack.config.js is a
// file-loader which loads any asset not caught by previous rules. We
// need to exclude `.wasm` files so that they are instead loaded by
// webpacks internal webassembly loader (which I believe is enabled by
// the experiment setting above).
//
// See https://github.com/facebook/create-react-app/blob/d960b9e38c062584ff6cfb1a70e1512509a966e7/packages/react-scripts/config/webpack.config.js#L587
webpackConfig.module.rules.at(-1).oneOf.at(-1).exclude.push(/\.wasm$/)
return webpackConfig
}
}
}
}