javascript - Does web essentials offer a way to use the bundled js file in production but individual js files in development? -


the setup:

i have large spa app using many javascript files bundled using web essentials bundling in visual studio 2013. include minified js files generated web essentials on html page. application not use asp.net

the problem:

i able distribute html page single minified script referenced production individual unminified scripts development.

reasons:

the minified scripts map files make difficult debug. variable , parameter names have been minified , debugger not match source. additionally, since in 1 file, hard @ development.

current solution:

i have grunt task goes html file , modifies such <script> tags replaced. has con of growing every file add page.

does web essentials offer better solution doing might have overlooked?

i have used bundler/minifier here: https://github.com/madskristensen/bundlerminifier

to see unbunded , unminified js , css have created helper render both depending on whether web application running debug enabled.

see: https://bundlerminifierhelper.codeplex.com/

example:

@html.bundle("/content/styles/site.min.css") @html.bundle("/scripts/scripts.min.js") 

note: using relative paths, including forward slash (/)

when debugging input files rendered out page, , when not debugging, supplied path rendered out.


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -