I'm trying to learn how to deploy an SPFx clientSide webpart to an office 365 developer tenant site assets location.

I have specified the https://myTenant.sharepoint/siteAssets URL on the write.manifest.json CDN string.

I have run the gulp bundle --ship and the gulp package-solution commands and finally have loaded the webpart solution sppkg into the app catalog site but I do not see anything on the siteAssets library.

Ehen I try to add the webpart to a page, I get an error. I could not post the error as I don't have enough points to post the error contents.

What am I doing wrong and what is the correct gulp command sequence? Or has this command sequence been eliminated?


Really new to this too, but I followed the guide at https://dev.office.com/sharepoint/docs/spfx/web-parts/get-started/deploy-web-part-to-cdn yesterday but was using my own host as CDN, so this is how I think it works:

gulp package-solution does not package the js, css or other assets.

You need to upload those assets to a location of your choice.

That location you specify in cdnBasePath is used when you generate the webpart with gulp package-solution.

I did like this:

  • gulp --ship
  • uploaded the generated files from temp\deploy to a CDN (in your case upload to https://mytenant.sharepoint/siteAssets )
  • change the cdnBasePath to the URL of CDN
  • run: gulp bundle --ship & gulp package-solution --ship
  • Upload the new webpart solution sppkg to Sharepoint App again

Hope it works for you too.

  • 1
    Completely correct. As an added bonus, you should try out the public CDN feature - dev.office.com/blogs/… and set your "cdnBasePath": "publiccdn.sharepointonline.com/WhatYouUsedToHaveHere" where you basically prepend "publiccdn.sharepointonline.com" to the path. Works like a charm, but you have to wait 15 minutes after configuring it. Also, unless you access the js from a SharePoint URL, you will get a referrer error. – PatMill_MSFT Feb 17 '17 at 22:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.