I have ASP.NET MVC application and files that are used across all CSHTML files (like jQuery, Bootstrap, Kendo JS, CSS and my own common JS file) are bundled and referenced in _Layout.cshtml.
The application have several views, partial views and most of the CSHTML have reference to their own individual JS file. How do i minify these individual files? ofcourse in debug mode i would like to use non minified file.
Should i create bundle of single file and reference it in CSHTML?
Or is there VS addon that will create minified files during development only and then in CSHTML i can do something like
#if DEBUG
<script src="~/Areas/Users/Scripts/Users/main.js"></script>
#else
<script src="~/Areas/Users/Scripts/Users/main.min.js"></script>
#endif
Is there any other option?
Comments:
This question is not duplicate. Question is about HOW to minify single JS, it is not asking whats the Value of adding single JS.