c# - MSBuild minify and embed JavaScript files -


i'm working on asp.net mvc application in visual studio 2015 , i'm trying find solution handle minifying , embedding our javascript files on release build. well, want find similar solution compiling less files , including them content in release build. main caveat here in debug build want javascript files , less files delivered make debugging easier.

current "solution"

currently project setup js files set "content" build action , minified counterparts set "embedded resource". keep these files in sync i'm using bundler & minifier extension. achieve debug builds using non-minified files have custom virtualpathprovider checks if file being requested js file , if exists local file, if returns local file otherwise attempts item embedded resource.

currently there no solution handling less files.

ideal solution

ideally i'd include both js files , less files content , not have have minified/compiled counterparts part of project. on debug build, nothing special happens, less files , js files returned are. on release build, javascript files minified , added embedded resources , less files compiled , compiled files included content.

i know part of solution writing virtualpathprovider on debug build returns files , on build looks embedded js files or compiled less files. part can handle pretty easily.

my question is, there way minify js files , embed minified files on release build? , there way compile less files , include compiled versions on release build?


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -