3

Closed

Bundler won't include a ".min.js" file unless there's also a regular ".js" file

description

Repro:
  1. Create a file foo.min.js with arbitrary code in it but do NOT have a foo.js file
  2. Add it to a bundle (possibly with other items)
  3. Create a site that calls Scripts.Render("~/mybundle")
  4. Run the page in either debug or release (but it's easier to see in debug)
Result:
The foo.min.js reference isn't included

Expected:
The foo.min.js reference should be included despite not having a non-minified version.

My app has many files that for legacy reasons have arbitrary filenames that for a variety of reasons must not be changed. Some of those files are already minified, but I still want to bundle them.

comments

howarddierking wrote Feb 12, 2013 at 8:39 PM

what does your bundle config file look like?
are you using the stable release or the latest alpha?

eilonlipton wrote Feb 12, 2013 at 10:08 PM

I am using Bundling 1.0.0.0.

My config looks something like this:
        bundles.Add(new ScriptBundle("~/scripts/jqueryplugins").Include(
                    "~/Scripts/jquery.tablesorter__.min__.js",
                    "~/Scripts/jquery.uitablefilter.js",
                    "~/Scripts/jquery.cookie.js",
                    "~/Scripts/jquery.autoresize__.min__.js"));
So, some files were always min-only (I don't have a non-.min version), and they were included explicitly.