I am new to SPFx, and I was wondering how can we update the solution after packaging it for the first time?
Do I need to run the gulp package-solution --ship
and add the sppkg file to SharePoint?
Kind Regards
The build chain of an SPFX Project is the below:
gulp bundle --ship
gulp package-solution --ship
The above chain produces a set of files(js, manifests and the sppkg) that implement your solution.
In order to upload or update your solution, all you have to do is to upload the produced sppkg file
to the App Catalog
and the manifests/js to the Cdn location
defined in config\write-manifests.json
of the SPFX project.
It is good, in general terms, to version each build to be incremented by the feature that you are trying to introduce to the SPFX App, but in general, versioning will not stop the update procedure.
More on versioning here
*the upload of the js/manifests depends on the target version of SharePoint and if the flag includeClientSiteAssets
is set to true (for example, SP2016 does not support it)
gulp clean
command to clean up old Build Files.