SharePoint Framework - ALM best practices with CDN

Brass Contributor

Hi folks,

 

I'm currently developing a Client Side Web Part which is deployed automatically to a Office 365 CDN which is defined in the "write-manifest.json".

 

This works quite fine but in the long term I plan to use different environments with at least "Integration", "Quality Assurance" and "Production".

 

So I need at least three different "cdnBasePath" values which will be set (dynamically?) when the project is being packaged and bundled.

 

I have something like this in my mind:

  • gulp package-solution --integration
  • gulp bundle --integration
  • gulp upload-to-sharepoint --integration
  • and so on

Are there any best practices on how to handle such requirements?

1 Reply

There is a ship flag for the upload-to-sharepoint task but it doesn't do much at present. You could use this flag to control publication of your scripts to test or production using custom code until something better shows up. Elio Struyf has an example: https://github.com/estruyf/UploadToOffice365SPFx.

There is a similar issue for the target URLs for different environments. Wictor Wilen has written a node package that can fix this up: http://www.wictorwilen.se/how-to-generate-sharepoint-framework-bundles-for-multiple-tenants. You could use a similar approach.

As the SharePoint Framework matures I think this will get integrated into the tooling, probably using that ship flag to specify different target environments.