locked
Bundling and Minification RRS feed

  • Question

  • User1308270069 posted

    Hi guys

    I have a big problem with bundling and minification in asp.net webpages.

    As you know, when we want to use it, we should set ' debug="false" ' in compilation tag in web.config but when I do that, my Scripts don't work any more. please help me if there is a solution.

    Thank you

    Sunday, February 12, 2017 4:39 AM

All replies

  • User-2057865890 posted

    Hi Saeed,

    You could use the ASP.NET Web Optimization Framework to bundle together and minify all scripts and CSS files. 

    It's available on NuGet and can be installed quickly via the following command:

    Install-Package Microsoft.AspNet.Web.Optimization

    reference: https://www.mikesdotnetting.com/article/197/optimising-asp-net-web-pages-sites-bundling-and-minification

    Best Regards,

    Chris

    Monday, February 13, 2017 7:11 AM
  • User1308270069 posted

    Thank you Chris, but I've already used this package that can use bundling and minification. the point is this tag in web.config.

    <compilation debug="false" targetFramework="4.5">

    the debug="false" stops js files so my slider, my counters and animations all don't work.

    Monday, February 13, 2017 7:24 AM
  • User-821857111 posted

    <compilation debug="false" targetFramework="4.5">

    the debug="false" stops js files so my slider, my counters and animations all don't work.

    What do you mean by "stops" js files? Are they not bundled and minified? That's what should happen.

    Wednesday, February 15, 2017 7:49 AM
  • User1308270069 posted

    It doesn't let my js files to work. before debug="false" I have slider and animations that work properly but after I set it to false, everything stop working. for example my slider doesn't show or my animations don't work.

    Wednesday, February 15, 2017 8:44 AM
  • User-821857111 posted

    You should use the developer tools in your browser to try to diagnose the problem.

    Wednesday, February 15, 2017 9:30 AM
  • User325035487 posted

    The issue faced by me when i tried bundling and minification was similar. I did the following to solve it.

    1. Make sure that js files are added in the required order to the Bundle Table.
    2. Some of the support files path was changed to bundletablename/filename.ext (to solve this i took the easier path and created a folder with my bundlename and put all my support files in a relative path inside that.

    hope this helps

    Wednesday, February 22, 2017 5:51 AM