[英]How to run React App created by create-react-app in Salesforce
I want to run a React app inside salesforce Lightning container.我想在 salesforce Lightning 容器中运行 React 应用程序。 I built the app with npm run build, upload zip file but nothing works.
我用 npm 运行构建,上传 zip 文件构建了应用程序,但没有任何效果。 All I can get is a blank page.
我所能得到的只是一个空白页。
Build folder before zip在 zip 之前建立文件夹
Zip and uploaded to Static resource Zip并上传到Static资源
In deveoper console在开发者控制台
<aura:application >
<lightning:container src="{!$Resource.Mirage + '/index.html'}"/>
</aura:application>
The preview page is blank and I don't know how to do it properly.预览页面是空白的,我不知道如何正确地做。 I feel like it cannot load my resource.
我觉得它无法加载我的资源。
Do I have to give up on CRA and build custom webpack?我是否必须放弃 CRA 并构建自定义 webpack?
Full disclosure: I never tried this.完全披露:我从来没有试过这个。 But it looks like you have to:
但看起来你必须:
To reference a file in an archive, use the URLFOR function.
要引用存档中的文件,请使用 URLFOR function。
I am not 100% sure this is the answer.我不是 100% 确定这就是答案。
Let me know.让我知道。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.