I’ve been tinkering with a simple SharePoint Hosted Add-In the last few days that required an assets library to come pre-populated with a collection of images.
A quick google seemed to only return results that referred to lists so I thought I’d put something out there that covered both!
Lists
Lists are relatively straight forward. Once you add your list to the solution, you can declare the rows in the elements file like so:
When the add-in deploys and you hit the list directly you will see that the data is now in there.
For libraries you must include the files via a module. First add a module to your solution:
Then add your images to the module:
Lastly, alter the elements.xml file to include a Url parameter that points to your library:
When your app is deployed the images will get copied into the library: