We have a SharePoint hosted app. This app require some scripts from SharePoint; MicrosoftAjax.js, init.js, sp.runtime.js, sp.js, sp.taxonomy.js and sp.workflowservices.js.
We load all these from /_layouts/15/, except for MicrosoftAjax which we load from ajax.aspnetcdn.com.
What we are thinking about is to bundle all these files into our app.js. We use gulp to build our app, so we only have one file, except for the files above.
Problems I can think of:
- How can we detect changes in the built in scripts?
- Are there differences between on-premise and SharePoint online?
- Are any parts of the scripts dynamic (variables set when requesting the scritps)?
We had problems with MicrosoftAjax.js, once it was removed from 15 hive, and once the DNS did not resolve.