Automatically minify JavaScript files at the time of Publishing website in Visual Studio 2010 or 2012?
15,128
Solution 1
Use MVC 4. It bundles multiple scripts and minifies them.
Solution 2
You can take a look at bundling and minification if you are using ASP.NET 4.5.
Author by
Rahul
Updated on June 18, 2022Comments
-
Rahul about 2 years
Is there any way in VS 2010 or 2012 to minify JavaScript files at the time of Publishing?
I want automatically minified js files. Any good example for compression?
Please note that I am not using MVC.
-
Rahul over 11 yearswith minification can we minify it at publishing time ?
-
Sidharth Mudgal over 11 yearsI think its done at runtime, i.e., when a request is made. You can enable caching of course.
-
Matt Wilson over 11 yearsAre there any (automated) ways of using ASP.NET bundling and minification without deploying the un-minified javascripts? For example, it may be fine for this to be done at runtime when the web application is being deployed your own server, but what if you are releasing a version for others to deploy onto their own intranet / server etc. and you don't want to include source?
-
Jeroen over 11 yearsIn my defense: OP edited his question, adding that comment after i answered it.