Reputation: 16936
Is there a standard way to share HTML/Javascript content over several visual studio projects? (a bit like Prism separates out modules for WPF).
Obviously this provides some issues for HTML apps, particularly in relation to Javascript.
If i was using MVC, i might be able to use this or this, but this project will use a SPA framework (likely to use RequireJs) and I would like to keep things standard.
The general site structures would be as shown below (where 'modules' are specific bits of functionality/views on data):
Site 1
Site 1 (config B)
Site 2
One option would be to include everything in one project with a config to decide what goes where. This could lead to a massive project though.
Another would be to have home baked helpers (as shown in the references) that copy files over from other projects when the project first runs, but this doesn't feel very neat in this instance.
Is there a standard way of achieving this goal?
I have done a lot of research, but cannot find a definitive answer.
Upvotes: 2
Views: 1013
Reputation: 183
There are now Shared Projects in Visual Studio to solve this problem. Universal Windows projects use them by default and you can create your own by downloading and installing the VS extension called the Shared Project Reference Manager found here: https://visualstudiogallery.msdn.microsoft.com/315c13a7-2787-4f57-bdf7-adae6ed54450
Note: At this time they can be picky about what type of project you try to add the shared reference. I created a JavaScript shared project to share js files between a Windows store js app and an MVC web app and it would not let me do that saying they had to be of the same language. (It supports C#, C++, or JavaScript).
Upvotes: 1