4

I have a SharePoint Online hosted app that I'm building that is an angular app. Typically i start the app out by doing all the angular UI stuff just using local development so I am able to easily build/debug/test and not worry about deploying anything. Once i get to the point that I'm ready to actually start wiring up the data side of things, i've packaged it up as a SharePoint hosted app.

When i encounter an issue, i'm finding it very difficult/time consuming to have to modify the files, repackage/deploy the app, just to see a small change. Is there an easier way to just modify the files in place on the host web or something like that so that I don't have to redeploy the entire app?

3
+50

I've recently started playing with using gulp tasks to set up watches on my source files, so that when they change they are automatically uploaded to the SharePoint document library where they need to go.

There are a couple of node/gulp libraries out there that do this.

gulp-spsave which I used in my most recent project

gulp-spsync which I'm going to look at next

So far I'm finding this a way better workflow than my previous techniques, usually one of:-

  • using SharePoint designer to edit the files
  • saving the file and manually uploading each time I made a change
  • using the Windows Explorer view to manage the files
  • Paul, this is great. But does it work with AppWeb? – Serhiy Mar 8 '16 at 8:23
  • 2
    I have found that it does! The only thing you need is to specify siteUrl like this "https://[domain].sharepoint.com/[yourAppName] – Serhiy Mar 8 '16 at 9:21
  • 1
    Cool, I haven't tried it yet specifically with the SharePoint-hosted app model, but sounds like you've got it worked out! – Paul Lucas Mar 8 '16 at 11:39
  • 2
    @Serhiy I'm the author of spsave and I didn't know that it works in that way! :). Thanks for noticing it. Actually there is a special property appWebUrl to support sharepoint-hosted webs. But with your info it useless. Currently I'm working on 2.x version and going to remove this option. – Sergei Sergeev May 22 '16 at 16:27
0

If you're using visual studio you can edit the files (html, css, javascript) in place without having to reload the solution by using the run command (F5, or the green play button at the top). Once you have your app open in VS, deployed, and running, all you need to do is modify a source file in VS and save it and VS will automatically upload the change to the server. That way all you do is hit refresh and see if your JS is doing what you want.

  • This feature seems random for me. Sometimes when I hit F5 Visual Studio goes to (Running) mode and every file change is uploaded. Sometimes it jues goes with usual deploment. Is there any way to "attach" Visual Studio to App Web instance? – Serhiy Mar 8 '16 at 7:38

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.