CommonJS downloader for browsers?

to increase the speed of my development, I would like to use commonjs for my client and server javascript, so I can use a common code base / libraries in all my projects. Why not AMD? browsers and node support AMD, but phantomjs does not, and I can move on to this later to create optimal (browsers) production collections.

Looking around, I can’t find ANY loader module that directly supports CommonJS. You always have to write / etc wrappers on top of them or require a reload of configurations.

Do I have any options?

+8
commonjs
source share
1 answer

no conventional loaders ......

so I ended up using AMD for browser and nodejs.

because I encode everything using Typescript for phantomjs I have a separate build process that takes my whole source and builds its mirror in commonjs format.

as I mentioned in my comment, you could use CommonJs in a browser with http://browserify.org/ , but this bundles everything into its own runtime, not what I want.

0
source share

All Articles