diff --git a/packages/react-scripts/config/paths.js b/packages/react-scripts/config/paths.js index acaca7f4d48..3945fbf7594 100644 --- a/packages/react-scripts/config/paths.js +++ b/packages/react-scripts/config/paths.js @@ -58,6 +58,7 @@ const moduleFileExtensions = [ 'json', 'web.jsx', 'jsx', + 'wasm', ]; // Resolve file paths in the same order as webpack diff --git a/packages/react-scripts/config/webpack.config.js b/packages/react-scripts/config/webpack.config.js index 6f5abcbb223..bef5c93f3cc 100644 --- a/packages/react-scripts/config/webpack.config.js +++ b/packages/react-scripts/config/webpack.config.js @@ -568,9 +568,9 @@ module.exports = function(webpackEnv) { loader: require.resolve('file-loader'), // Exclude `js` files to keep "css" loader working as it injects // its runtime that would otherwise be processed through "file" loader. - // Also exclude `html` and `json` extensions so they get processed + // Also exclude `html`, `wasm` and `json` extensions so they get processed // by webpacks internal loaders. - exclude: [/\.(js|mjs|jsx|ts|tsx)$/, /\.html$/, /\.json$/], + exclude: [/\.(js|mjs|jsx|ts|tsx|wasm)$/, /\.html$/, /\.json$/], options: { name: 'static/media/[name].[hash:8].[ext]', },