create-react-app 当构建 .wasm 文件时,未检测到 magic header,

wwtsj6pe  于 20天前  发布在  React
关注(0)|答案(3)|浏览(23)

你好,
我在create-react-app项目中使用了.wasm文件,但是当我运行'npm run build'时,遇到了错误:模块解析失败:未检测到魔术头。我已经根据这篇文章将'wasm-loader'添加到了项目中。然而,当我在vue-cli中导入相同的.wasm文件时,它可以正常工作。create-react-app是否支持.wasm文件?或者能否更改默认的webpack配置以支持此功能?谢谢!

fbcarpbf

fbcarpbf1#

The default webpack config needs to remove wasm types from being loaded with file-loader
https://dev.to/lokesh007/webassembly-with-rust-and-react-using-create-react-app-67

smdnsysy

smdnsysy2#

这个问题已经被自动标记为过时,因为它没有任何最近的活动。如果没有发生任何进一步的活动,它将在5天后被关闭。

uurv41yg

uurv41yg3#

你已经过时了,机器人。

相关问题