radbyx
radbyx

Reputation: 9670

Does it make sense to put a "min.js" fil in MVC Bundles?

When using MVC bundeling in BundleConfig.cs, the .js files is minified right?

So what if I use a min.js? Is it good or bad practice and why?

bundles.Add(new ScriptBundle("~/bundlesJs/scroller").Include(
    //"~/Scripts/Common/scroller-dataTables.scroller.min.js" // .min version
    "~/Scripts/Common/scroller-dataTables.scroller.js") // not .min version
);

Upvotes: 2

Views: 50

Answers (1)

Rahul Nikate
Rahul Nikate

Reputation: 6337

.min means minified version of script file. Minification isn't compression. It refers to the removal of whitespace and other nonessential characters like comments so that the code is still valid but as compact as possible.

As such, it is not recommended for development because it makes the code much less readable and much harder to edit.

Minified code is still valid code in all respects and can be run immediately.

Minification happens anyway as part of the compilation process in most languages. By pre-minifying the files, you simply speed up the download and parsing process by a certain amount.

Upvotes: 1

Related Questions