System.Web.Optimization
on Visual Studio 2013 was giving us Bundling on javascript files and the best part of that was allowing us to go with indiv
The old style optimization bundling will not be available in VS2015 for ASP.NET 5.0 applications: https://github.com/aspnet/Home/issues/134
[Edit] BundlerMinifier Extension can do Bundling and minification as a Visual Studio Extension it has limited capabilities compare to GULP, GRUNT or My favorite WebPack but if you want an easy solution https://github.com/madskristensen/BundlerMinifier is the one
long story short like ecm_dev said old style optimization bundling will not be available this is the right answer, but it wasn't helping me to solve my bundling and minification problem and last a few months it pushed me to find replacements which were actually there Bower, Gulp, Grunt which Microsoft is pushing us to use
I picked the Bower as a package manager Bower is the replacement for nuget on client files (css,js,less etc..) and Gulp as a build task op
gulp-bower Help you to pull Bower packages
main-bower-files Extract Bower files in right locations
gulp-concat bundles your css or js files (any file)
gulp-uglify minify your js files
gulp-less compile your less files
gulp-cssmin minify your css files
gulp-inject inject your css and javascript tags into your .html or .cshtml
Gulp is actually more capable than System.Web.Optimization + Web Essential combine but has lot to learn this may not the answer you are looking for (when I first asked this question a little longer a month ago it definitely wasn't mine)
but if you are looking for this question, you have the same problem I had for
enable gulp on VS 2015 : http://tom.cabanski.com/2014/11/23/using-gulp-with-asp-net-vnext-and-visual-studio-2015-preview/
gulp 101: http://ilikekillnerds.com/2014/07/how-to-basic-tasks-in-gulp-js/
I like to watch video: https://www.youtube.com/watch?v=dwSLFai8ovQ
and here another blog post: http://mmercan.com/blog/?p=271
Prior to Web Essentials 2015 Bundler and Minifier were both included in the core plugin. With Web Essentials 2015 that is no longer the case and have been seperated into its own plugin (Plugin on Visal Studio Marketplace)
Also to note, transitioning to the new plugin has you utilizing a bundleconfig.json
file on the root of your project in lieu of the individual .bundle
configuration files.
After reading through the documentation and examples provided here, I immediately had the same question. After the bundling and minification steps, the docs just say "Now reference the files".
I did quite a bit of research trying to find a best practice to use for conditionally referencing scripts for development and others for production. The options I like the most are:
Documentation for WireDep and gulp-inject are provided in their respective links.
To use the environment tag helper, make sure your _GlobalImport view file has the following line in it.
@addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers"
Then use it like this:
<environment names="Development">
<script src="~/js/script1.js"></script>
<script src="~/js/script2.js"></script>
<script src="~/lib/big-script-library.js"></script>
</environment>
<environment names="Staging,Production">
<script src="~/js/bundle/script.min.js"></script>
<script src="http://www.some-cdn-resource.com/big-script-library.min.js"></script>
</environment>
The environment names correspond to the ASP.NET 5 environment variable ASPNET_ENV.
After I complain for a whole day to Visual Studio 2015 for moving my cheese, I calmed down and just when ahead to find out how to do it the new way, I now I back to loving vs2015 :)
If you already had all your files configured, don't worry do not delete your existing configuration we will use it
<file> </file>
tagsand that's it... your new config is now setup
you can get more info about the new bundler here
https://visualstudiogallery.msdn.microsoft.com/9ec27da7-e24b-4d56-8064-fd7e88ac1c40