在 BundleConfig.cs
中使用 MVC
捆绑时,.js
文件被缩小了,对吧?
如果我使用 min.js
会怎样?这是好事还是坏事?为什么?
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
);
最佳答案
.min
表示脚本文件的缩小版本。
缩小不是压缩。它指的是删除空格和其他非必要字符(如注释),以便代码仍然有效但尽可能紧凑。
因此,不推荐用于开发,因为它会降低代码的可读性和编辑难度。
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.
关于javascript - 将 "min.js"文件放入 MVC 包中是否有意义?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36282569/