JavaScript Libraries - why developed in just one file?


I’ve been using JS for over a year now, and every project we work on is split into modules. All of the tutorials and demos I’ve seen are also modular. But… most of the libraries I’ve used seem to be developed in a single file. e.g. velocityjs -
Why is this? Do you think that maybe the project is being developed in a modular fashion, and then committed to GitHub as a single file? Although I doubt this.

Ta, B

well, importing only one file/module per library makes kind of sense, doesn’t it?


Certainly for using the library, the one file is how it works. But I’m talking about during development of the library. We could be looking at 2-10k lines of code. It seems crazy that everybody is developing projects in a module format, but that many libraries are developed as a single file. I would have thought they would be developed using modules, and bundled into one file for importing

For example, JQuery is developed as a modular project, with many source files,, and then exported as a single jquery/jquery.min.js file

The velocityjs project I mentioned in the first post is in a single 4.7k line file.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.