Right now my sharepoint site consists of one page, which has only a web part placeholder containing a content editor web part that links to my Vue.JS app. So basically I've created some sort of SPA in a hacky way.

However, this generates problems in my app which I can't solve. Other downsides are that my vendor/app files are all included in the body of the page instead of the head (because the web part lives in the body). What other options are there to 'host' an app (Vue, react, angular, whatever) through sharepoint which allows you to use it as a single page application?

I'm running SP on Prem 2013


For SharePoint Online or SharePoint 2016+

If you're running SharePoint Online or SharePoint 2016 or later, you can develop client side webparts in SharePoint Framework (SPFx).

There's lots an lots of examples out there, and they're constantly updating it's functionalities.

For more info, see https://docs.microsoft.com/en-us/sharepoint/dev/spfx/sharepoint-framework-overview

For SharePoint 2013 or older

If you're running SharePoint 2013 or older however, you could create a custom page layout with the necessary code on it already. This way you can force your vendor/app code to be added to the .

More info at https://docs.microsoft.com/en-us/sharepoint/dev/general-development/how-to-create-a-page-layout-in-sharepoint

  • Thank you. I'm running 2013 on prem (I'll edit my post). I'll try out the custom page layout. – Frank Dec 18 '18 at 16:01

CEWP is not exactly SPA since, as you mentioned, it resides in the body.

I would not be too worried about your app scripts being references in the body rather than a head. It might feel dirty, but in the end I personally see no issues here.

If you want to control an entire page and get a real SPA then you can put your entire app inside a separate HTML file and give it an .ASPX extension. Then save it either in the /_masterpage/ library or in /Pages, it's up to you.

If you want to setup a proper development environment for Vue, React or Angular with SharePoint 2013 then I highly recommend sppp yeoman generator. It has webpack and very useful gulp tasks already setup.

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