Outlook加载项生产和开发部署
我使用Yeoman Generator创建了一个React-Outlook加载项,并在Oracle Web Logic Server中成功部署了WAR文件。
但是,每当我进行少量更改时,我都需要创建一个新的战争文件并一次又一次地部署以测试加载项。由于CORS策略错误(无法调用API),我无法在Localhost中部署该加载项时测试它。
由于创建战争文件并在服务器中一次又一次地部署它们是一个繁琐的过程,是否有一种方法可以轻松测试加载项或一种使同一过程变得轻松一点的方法?
目前,每当我对需要测试的代码进行更改时,我都会遵循这些步骤。
- 创建DIST文件夹(NPM Run Build)
- 生成战争文件,
- 将战争文件复制在我的本地文件夹中,并将其粘贴到网络文件夹中
- ,
如果它有所帮助,我可以在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.
- Create the dist folder (npm run build)
- Generate the war file
- Copy the war file in my local folder and paste it in the network folder
- 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用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.