简体   繁体   English

如何运行Salesforce中create-react-app创建的React App

[英]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.

相关问题 如何在codepen中运行使用“create-react-app”创建的react项目? - how to run react project created with "create-react-app" in codepen? 如何在create-react-app创建的应用程序中使用jsx文件(不运行“npm run eject”)? - How to use jsx files in an app created by create-react-app (without run “npm run eject”)? 如何在使用 create-react-app 创建的应用程序中设置环境变量? - How to set environment variables in app created with create-react-app? 如何从链接中删除“使用 create-react-app 创建”? - How to delete "created using create-react-app" from links? 如何运行/部署一个通过使用Apache Tomcat中的create-react-app(根据文档)创建的React + redux应用 - How to run /deploy a React+redux app which is created by using create-react-app (as per document ) in Apache Tomcat 将使用 create-react-app 创建的 React 应用程序集成到外部应用程序中 - Integrate React app created with create-react-app into an external application 如何在我的 Create-React-App 中使用 @salesforce/design-system-react 包 - How to use the @salesforce/design-system-react package in my Create-React-App 运行“ create-react-app”失败 - Run 'create-react-app' failed 如何在服务器上运行reactjs(使用create-react-app) - How to run reactjs (using create-react-app) on a server 如何指定一个端口来运行基于 create-react-app 的项目? - How to specify a port to run a create-react-app based project?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM