Outlook加载项生产和开发部署

发布于 2025-02-08 18:01:24 字数 634 浏览 3 评论 0原文

我使用Yeoman Generator创建了一个React-Outlook加载项,并在Oracle Web Logic Server中成功部署了WAR文件。

但是,每当我进行少量更改时,我都需要创建一个新的战争文件并一次又一次地部署以测试加载项。由于CORS策略错误(无法调用API),我无法在Localhost中部署该加载项时测试它。

由于创建战争文件并在服务器中一次又一次地部署它们是一个繁琐的过程,是否有一种方法可以轻松测试加载项或一种使同一过程变得轻松一点的方法?

目前,每当我对需要测试的代码进行更改时,我都会遵循这些步骤。

  1. 创建DIST文件夹(NPM Run Build)
  2. 生成战争文件,
  3. 将战争文件复制在我的本地文件夹中,并将其粘贴到网络文件夹中

如果它有所帮助,我可以在webpack.config中看到以下两行。 JS文件也

const urlDev = "https://localhost:3000/";
const urlProd = "https://www.contoso.com/"; // CHANGE THIS TO YOUR PRODUCTION DEPLOYMENT LOCATION

提前感谢您!

I created an react-outlook add-in using the yeoman generator and successfully deployed the war file in the oracle web logic server.

However, whenever I make small changes I need to create a new war file and deploy it again and again to test the add-in. I cannot test the add-in when it is deployed in the localhost due to CORS policy errors (Cannot call APIs).

Since, creating war files and deploying them again and again in the server is a tedious process, is there a way to easily test the add-in or a way to make the same process a bit easy?

Currently, I'm following these steps whenever I make a change in the code that needs to be tested.

  1. Create the dist folder (npm run build)
  2. Generate the war file
  3. Copy the war file in my local folder and paste it in the network folder
  4. Publish it in the oracle server

If it helps, I can see following two lines in the webpack.config.js file as well

const urlDev = "https://localhost:3000/";
const urlProd = "https://www.contoso.com/"; // CHANGE THIS TO YOUR PRODUCTION DEPLOYMENT LOCATION

Thank you in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

阪姬 2025-02-15 18:01:24

您可以使用WebPack自动化生成和复制战争文件为DIST文件夹的过程。

当您构建加载项的调试或发布版本时,使用帖子中提到的URL。取决于清单文件包含适当的URL,因此您可以在本地或任何Web服务器中运行它。

至于CORS,请参见解决可能解决方案的办公室附加组件中的相同原始策略限制

You can use webpack to automate the process of generating and copying the war file to the dist folder.

The URLs mentioned in your post are used when you build a debug or release version of the add-in. Depending on that the manifest file contains the appropriate URLs, so you could run it locally or from any web server.

As for CORS, see Addressing same-origin policy limitations in Office Add-ins for possible solutions.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文