dynamicbundles icon indicating copy to clipboard operation
dynamicbundles copied to clipboard

Both foo.js and foo.min.js are bundled

Open RudeySH opened this issue 8 years ago • 3 comments

If a view folder contains both a regular JavaScript file, and a minified version, Dynamic Bundle includes both files in the generated bundle.

Dynamic Bundle should ignore the minified version if there is a regular version. ASP.NET itself should take the minified version in Release mode.

Same goes for bar.css and bar.min.css by the way.

RudeySH avatar Jan 28 '17 03:01 RudeySH

I think you are supposed to delete the .min. version and let the bundler handle everything.

optimally it would pick the .min. version and simply inline it though...

Montago avatar Jun 20 '18 06:06 Montago

Deleting the minified file definitely prevents Dynamic Bundles from bundling the same thing twice, but you shouldn't have to do it. It's a problem that is easily fixed in Dynamic Bundles. Also, deleting files is not always an option. For example, when you're using a package manager to download your dependencies, you almost always get a non-minified and a minified version, and there's no point in deleting one of them because an update of dependencies automatically restores them.

Furthermore, I don't consider it optimal to always pick the minified version. While developing it's beneficial to use non-minified scripts. This improves the debugging experience when using browser developer tools.

RudeySH avatar Jun 20 '18 08:06 RudeySH

What i meant was:

Debug -> pick normal JS Release / Minify / Bundle -> pick .min.js

Montago avatar Jun 20 '18 10:06 Montago