I have found several articles referenced below about how to do this in SPOnline and I've see how to reference SPOnline CDN for OnPrem. I want to make several public libraries available for all our internal sites, but I don't want to edit the master page for each site collection. What is the best practice?

Reference; Reference; Reference; Reference;


$farm = Get-SPFarm
$wa = Get-SPWebApplication http://webAppUrl
$wa.WebService.SideBySideToken = $farm.BuildVersion.ToString()
$wa.WebService.CdnPrefix = "static.sharepointonline/bld"
$wa.WebService.EnableCdn = $true
  • Want to include the libraries of Font Awsome, MomentJS, and JQuerry
    – Jammin4CO
    Jan 16, 2018 at 22:05

1 Answer 1


In SharePoint On-Premise, we can create a FARM feature and deploy all those scripts to Layout folder. then you can refer all the resource files in multiple site collections.

Check the articles below

Packaging and Deploying SharePoint Solutions

Deploy Custom Css file in SharePoint with Solution Package

  • Thank you for your response, but that will create duplicate files on every site collection. I would like to be able to reference multiple CDNs that are hosted by 3rd parties, ie, Google.
    – Jammin4CO
    Jan 17, 2018 at 16:36
  • Deploy to Layout(C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\template\layouts) folder in server, not create duplicate files on every site collection.
    – LZ_MSFT
    Jan 18, 2018 at 1:33
  • I see, but to use them, I will need to use a custom master page to make use of them, correct? Will the libraries in the layouts folder be available to a CWEP?
    – Jammin4CO
    Jan 18, 2018 at 15:23
  • Yes, we can refer to the js/css files in Content Editor Web Part or Script Editor Web Part.
    – LZ_MSFT
    Jan 19, 2018 at 1:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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