0

我正在使用 jquery fileupload 插件,它加载了 7-8 个 js 文件。现在其他开发人员也在现场工作,有时会造成混乱,很难找到在哪里使用了哪个 js 文件。

所以我在想我是否可以将 7 个文件合并到一个文件中,这样我就可以知道那是我的文件

4

3 回答 3

1

试试这个来编译你的 javascript 文件或代码。

http://closure-compiler.appspot.com

于 2012-11-02T08:07:04.983 回答
0

I use Rake to compile Javascript (and SASS to CSS, as well). It minifies the files in a unique JS. It's written in Ruby, but it's easy to configure and it works very fine.

But if more developers are working on the same code, another good idea I strongly suggest is to to use a SVN (sub-version control system), as TortoiseSVN or Git. This will allow many developers to work on the same source files, without losing any change.

于 2012-11-02T08:40:43.770 回答
0

虽然在这种特殊情况下可能有点矫枉过正,但可能值得一试grunt。它可以让您在处理文件时将文件分成多个文件,并在任何文件更改时根据需要编译、缩小并将它们组合成单个/文件组,同时还允许您定义负载你的代码的顺序。

它在您第一次运行时需要进行一些设置(稍后您可以将其用作模板),但极大地改进了组合/缩小文件的过程,并且还支持处理coffescriptsass等,以及为你的代码。

于 2012-11-02T08:26:30.760 回答