Forum Discussion

Alan Trafford's avatar
Alan Trafford
Brass Contributor
Nov 27, 2017
Solved

Testing an updated web part, on a live SharePoint site, without affecting the existing version

Hi   Modern experience.   I have an updated version of a web part that I need to test on a live SharePoint site. This needs to be done without affecting the existing version of the web part. ...
  • Russell Gove's avatar
    Nov 28, 2017

    The Site collection app catalog should help when it becomes available, but until then you can deploy a Test version of the App to the app catalog and your cdn and deploy the test version to your test site.

     

    in package-solution.json change the  solution name  to test-yourappname and the id  to a new guid and the zipped package name to solution/test-yourappname. This will make the app unique.

     

    in write-manifests.json change the cdnbasepath to a new folder where you will deploy you deploy your test code so that it does not interfere with the production code.

     

    for each of your webparts  in the webpart.manifest.json change the Id to a new guid. You cant have two webparts in a tenat with the same id.

     

    then gulp clean; gulp bundle --ship,  gulp package-solution --ship. This will create a new sppkg file for your test app , with a different name (test-yourappname) that references the different cdn location you specified in write-manifests.json.

    note: for each of these files, I keep a .production and a .test version  in my project so I can just copy  the contents from either file when I am ready to deploy. It would be awesome if we could have gulp do that for us!

     

    then  upload the test sppkg to your app catalog  (solution/test-yourappname.sppkj) and deploy the files in temp deploy to the folder you specified in write-manifests.json to your cdn. You can then deploy your test app to your test site without interfering with production. You can even have the two versions running side-by-side in the same site collection,

     

    Its a bit of work, but it has been working consistently for me for months now.

     

     

     

     

Resources