Webpack 带网页包的A-Frame资产源
我已使用Webpack设置了一个A-Frame项目,并尝试使用PNG和glbs等文件作为A-asset源,但是,我收到“加载资源失败:服务器响应状态为404(未找到)”错误 我已经设法用下面的代码获得了类似的东西,但我更愿意在场景中使用框架的a资产 body.html:Webpack 带网页包的A-Frame资产源,webpack,aframe,src,Webpack,Aframe,Src,我已使用Webpack设置了一个A-Frame项目,并尝试使用PNG和glbs等文件作为A-asset源,但是,我收到“加载资源失败:服务器响应状态为404(未找到)”错误 我已经设法用下面的代码获得了类似的东西,但我更愿意在场景中使用框架的a资产 body.html: <a-scene> <a-box id="box" position="0 0.5 -4"></a-box> </a-scene>
<a-scene>
<a-box id="box" position="0 0.5 -4"></a-box>
</a-scene>
import boxTex from './assets/box-tex.jpg';
function component() {
let entity = document.getElementById('box');
entity.setAttribute('src', boxTex);
}
component();