Serving bundled JavaScript with a pure AppHost implementation of ServiceStack -


i use servicestack pure apphost implementation without using mvc. want use drive single page app.

serving spa's single html shell page straightforward enough , i've found plenty of examples on doing that. however, need serve number of javascript files , i'm assessing best way of doing this. can put script tags in html shell page don't benefits of bundling , minification, , have maintain every time add new javascript file.

all these problems solved bundling solutions such cassette or asp.net mvc4 bundles. how use these servicestack apphost?

the servicestack.bundler project great seems have dependencies on asp.net mvc, e.g. base html helpers render javascript tags in html.

i'd able without dependency on mvc, if possible.

if haven't taken @ gruntjs yet, it's worth (http://gruntjs.com/). creating simple tasks, can combine & minify html, js, , css , has no dependency on .net. there lot of other useful tasks available gruntjs (js lint checks, js unit test running, , tons more). can setup different tasks environments (ie, don't combine/minify when deploying dev server).

what allows create purely static html, css, , js spa, , can manage in different solution/project servicestack apphost.

so in example, you'd reference scripts in index.html file , when you're ready deploy staging/production you'd run grunt task bundle/minify code , output static html, min.css, , min.js files deployment directory. it's powerful , flexible.

i used use bundler , made switch gruntjs , haven't looked back.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -