It is a continuation of previous article, if you’ve missed it. I recommend you to first walkthrough the links provided above suggestion for SharePoint Framework.
In this article, I’ve used same project which I had created in previous article “How to Provision SharePoint assets with solution packages“.
Here, I’ll demonstrate, how to upgrade existing SharePoint Framework (SPFx) app in SharePoint Online.
Now, open existing project in Visual Studio Code and add a new element file named as “elements-v2.xml” with content showed below:
Add another XML file “upgrade-actions-v2.xml” for upgrade action. It should’ve location based on the folder name as a GUID which is placed under SharePoint -> Solution -> debug.
Now make below highlighted changes in “package-solution.json”. You must change below mentioned attributes:
- version – It should be increased.
- elementManifests – It will also include “elements-v2.xml” file.
- upgradeActions – It will hold file name of upgrade actions i.e. “upgrade-actions-v2.xml”
Now run below command:
gulp bundle –ship
Thereafter, create a package for our solution using below command:
gulp package-solution –ship
Now, again deploy (refer “How to Provision SharePoint assets with solution packages”) package .sppkg file. After deployment, you’ll see upgraded version of file in app catalog as below:
If you click on app’s tile, you shall see message to to get upgraded version of app.
Click on Get IT button and see the effect. You’ll see additional new list under site contents.
Thank you for reading…
I hope you enjoyed learning this tutorial and It will help you to move forward in SharePoint Framework (SPFx) world.
Please share your suggestions in the comment box below about this tutorial. This will help me to provide useful content moving forward .
Also don’t forget to share, subscribe and follow Three Queries on social media.
Thank You for your Time!
THREE QUERIES is SharePoint, front-end, back end web technologies and project management resource that helps developers, artchitect and managers at all levels to improve their performance. We provide an important knowledge base for those involved in managing, architecture and developing projects of all kinds. With weekly exclusive updates, we keep you in touch with the latest SharePoint, front-end, back end web technologies and project management thinking.
WE ARE CONNECTED ~ Follow us on social media to get regular updates and opinion on what's happening in the world of SharePoint, front-end, back end web technologies and project management. If you like this article, please share it and follow us at Facebook, Twitter, Instagram, Pinterest and LinkedIn