asp.net mvc - How to put TypeScript sources into separate VS project? -
i have long-running web project (3-4 years old), based on asp.net mvc 5. have large client-side codebase too, written in typescript. due earlier conventions, typescript sources part of mvc 5 csproj
project, gets compiled back-end.
this structure unfortunate due many reasons. few main ones are: violation of srp, coupled backend, no way separately maintain , build backend, no way separately maintain , build front-end, etc.
i'd separate client-side codebase new visual studio project, however, have no idea best way be, visual studio doesn't provide way have clean typescript projects (at least far know).
i'm using visual studio 2015 typescript 2.0. options have?
first, if client-side code (the typescript application) not need own web.config
file — is, don't need configure iis authorization, redirects, etc. — can use "html application typescript" project type in visual studio.
however, if both client , server code need own web.config
, deployed same iis web site, having 2 separate asp.net projects becomes more difficult, because 1 needs merge 2 web.config
files… impossible, afaik.
i facing similar problem, in case had angularjs-based web application programmed in typescript, , asp.net web api backend.
the best think of far doesn't require additional build steps not move typescript code separate project, move web api / mvc code instead. client-side typescript ends in asp.net web project, web api goes class library.
two remaining pain points shared web.config
, bootstrapping web api via global.asax
, ends in "wrong" project. regarding web.config
, might possible further extract web api configuration separate .config
file via configsource
mechanism. don't see way web api bootstrapping in global.asax
out of (otherwise client-only code) asp.net project.
Comments
Post a Comment