It is a continuation of previous articles on SharePoint Framework, if you’ve missed it. I recommend you to first walk through the links provided above in suggestion.
Now, open existing project in Visual Studio Code.
Right click on sharepoint folder and add a subfolder “assets”. In “assets” folder, add an XML file named as “element.xml”.
This file contains CAML based declaration to create list instance in SharePoint.
Now, select “package-solution.json” under config folder and add “element.xml” entry.
After saving above file, run below command.
gulp bundle –ship
SharePoint Framework supports two types of builds, which are a debug build and a release build. Both are triggered, using the Gulp bundle task.
If you request a release build, using the gulp bundle –ship command. SharePoint Framework will generate optimized bundles and copy them to the temp/deploy folder.
Once we run the commands given above, then get the bundle file from your project folder, open your project folder – temp – deploy.
In deploy folder, copy all the files and add in SharePoint library path or CDN, which you mentioned in write-manifests.json file in the project.
Once you completed the steps given above, upload the app in an app catalog and install in your SharePoint site.
Get .sppkg file from <project folder> – sharepoint – solution – <helloworldsample-webpart.sppkg>
Inside solution folder, copy the .sppkg file and upload it in an app catalog.
After you uploaded the app file, you will get the pop up, as shown below and click Deploy to trust the client side Webpart.
Now, install the app using the option “add an app” Site Contents. You will see that new list is created automatically.
Add the client app part in your pages or modern site pages.
In this article, we have understood how to take the build for client side Web part and deploy SharePoint assets using the Web part in SharePoint Online. Similarly you can provision other SharePoint components using SharePoint Framework (SPFx).
Thank you for reading…
Please like, share and subscribe!
Hope you enjoyed reading it.
Please don't forget to Share, Follow and Like to get updated with latest posts.
It gives me motivation to share more knowledge with you.
Project Management Professional (PMP) and Microsoft certified, motivated, energetic and accomplished Project Manager / Architect with 15+ years of work experience in Management, Architecture, Analytics, Development and Maintenance. I have been fortunate to be a part of over 25+ .Net / SharePoint projects delivery with various companies across different industry sectors. This has provided me a valuable insight and experience especially in successful implementation of SharePoint based solutions.
My experience in Web application implementation includes technology strategy and road-map definition, business and technical requirements identification, governance, platform architecture, solution design, configuration, development, quality assurance, training, post-production support, team lead and overall project delivery along with project management.
Satyendra Mishra holds a B.Tech. in Computer Science & Engineering and PG Diploma in Advance Computing from Center for Development and Advance Computing, Pune, India. He is also a certified Project Management Professional (PMP).
I love to share Project Management Tips and Tricks by writing Blogs in the Project Management India Community. I have written around 300+ articles in the Project Management, .Net, SharePoint and related client side technologies.