JS - one huge file or many small files? - where to draw a line?

前端 未结 5 1732
悲哀的现实
悲哀的现实 2021-01-04 04:36

Is there a good rule of thumb as to how big (in size) a JS file should be - that if it grows bigger than this it\'s good idea to split it into smaller files?

5条回答
  •  花落未央
    2021-01-04 04:52

    The same size as any other languages (never more than a few hundred lines), and the concat and minify at runtime (using the Closure compiler or the Yahoo libs or whatnot) is what we do.

提交回复
热议问题