Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7634625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:13:35+00:00 2026-05-31T07:13:35+00:00

I’ve started using bundling and minification included with the MVC4 Beta. I’m running into

  • 0

I’ve started using bundling and minification included with the MVC4 Beta. I’m running into a few issues with it:

For one thing, if I use the classic <script src="Folder/js" type="text/javascript"/> bundling, it seems like I have to rename my files to make sure they’re bundled in the proper order.

  • Let’s say I have three javascript files: “ants.js”, “bugs.js”, “insects.js”
  • ants.js depends on bugs.js
  • bugs.js depends on insects.js
  • Default bundling seems to bundle them in alphabetical order.
  • To get them to bundle properly, I have to rename them to: “0.insects.js”, “1.bugs.js”, “2.ants.js”
  • That’s really hackish and there has to be a cleaner way.

The next problem I’m having is debugging. I like to step through the javascript in my testing browsers, is there a way to turn off just the minification while in DEBUG mode?

EDIT: To be clear, I know I can create bundles and register them from C#, it just seems really ugly to have to do it that way.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T07:13:36+00:00Added an answer on May 31, 2026 at 7:13 am

    To temporarily get non-minified output use this

      public class NonMinifyingJavascript : IBundleTransform
    {
        public void Process(BundleContext context, BundleResponse bundle)
        {
            if(bundle == null)
            {
                throw new ArgumentNullException("bundle");
            }
    
            context.HttpContext.Response.Cache.SetLastModifiedFromFileDependencies();
    
            foreach(FileInfo file in bundle.Files)
            {
                HttpContext.Current.Response.AddFileDependency(file.FullName);
            }
    
            bundle.ContentType = "text/javascript";
            //base.Process(context, bundle);
        }
    }
    

    If you wanted it based totally on a config setting, I imagine you could create an IBundle transform that delegates to this one or JsMinify depending on your config setting

    In order to control the ordering of the javascript files you need to use the BundleFileSetOrdering

     var javascriptBundle = new Bundle("~/site/js", new NonMinifyingJavascript());
    
             //controls ordering for javascript files, otherwise they are processed in order of AddFile calls
             var bootstrapOrdering = new BundleFileSetOrdering("bootstrap");
             //The popover plugin requires the tooltip plugin
             bootstrapOrdering.Files.Add("bootstrap-tooltip.js");
             bootstrapOrdering.Files.Add("bootstrap-popover.js");
             BundleTable.Bundles.FileSetOrderList.Add(bootstrapOrdering);
             javascriptBundle.AddDirectory("~/Scripts", "bootstrap-*.js");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am reading a book about Javascript and jQuery and using one of the
I have a French site that I want to parse, but am running into
I am currently running into a problem where an element is coming back from
I'm making a simple page using Google Maps API 3. My first. One marker
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I want use html5's new tag to play a wav file (currently only supported

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.