Question

I am using Visual Studio 2012 to create a class library project that will also include a number of TypeScript (.ts) files, as well as their generated .js and .js.map files. All of these files need to be included in the assembly as embedded resources, so that they can be exposed to a consuming ASP.NET MVC application via a custom VirtualPathProvider.

Note: although only the generated JavaScript files are essential for the production environment, the .ts and .js.map files must also be accessible to the web application, for debugging.

This presents a conflict, since TypeScript files are usually assigned the TypeScriptCompile build action but I also need them to be assigned EmbeddedResource.

Is there any way to assign multiple build actions to a VisualStudio project component? Alternatively, is there another way to get TypeScript to compile files that are not explicitly marked as TypeScriptCompile or to get Visual Studio to embed files that are not marked as EmbeddedResource?

Thanks for your suggestions,

Tim

Was it helpful?

Solution

If you had a TypeScript file that referenced all of the others, only it would need to have the TypeScriptCompile type as the compiler should walk all the dependencies and compile all the rest too.

So creating a file that acts as the compilation target and that references all of your other files might allow you to change all the rest to EmbeddedResource.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top