Javascript Bundling on visual studio 2015

后端 未结 5 1361
Happy的楠姐
Happy的楠姐 2021-02-14 06:01

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

5条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-14 06:48

    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

    1. Install Web Essentials for 2115
    2. Select the files you want to bundle, if you already had the files configured and are too many only select a couple we can edit the config later
    3. right-click and select "Bundle and Minifier" - "Bundle and Minify Files" (Shift-Alt-F)
    4. Save the bundled in your prefeer location (maybe with a different name from the previous one, so you don't override it)
    5. the first difference is that you will not see yourfile.js.bundle. Instead there is a new bundleconfig.json at your root folder
    6. if you open the file you can see now you can have only one config file for all your bundles
    7. Now you can copy your existing configuration from yourfile.bundle which is XML and that's ok
    8. Paste into the new bundleconfig.json and just remove all the tags

    and 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
    

提交回复
热议问题