Loading CSSOM as a non-AMD script
This will give you CSSOM in one file.
CSSOM has instructions to build it as a browser script, from its github site:
$ git clone https://github.com/NV/CSSOM.git
$ cd CSSOM
$ npm install -d
$ ./node_modules/.bin/jake
Based on what I see there, you'd then only need a shim
configuration that states:
CSSOM: {
exports: 'CSSOM'
}
Using r.js
This will give a bunch of modules making up CSSOM. If you'd want a final single file from this, you'd have to ask r.js
to optimize the result of ding r.js -convert
.
Use r.js
to convert the code base of CSSOM
:
$ r.js -convert in out
Where in
is the source tree of CSSOM
and out
is where you want to result to be. Because CSSOM says it is pure JS this conversion will probably work without having to do anything else, because I'd expect CSSOM
to not use Node-specific modules like fs
. But there could be some other problems. If CSSOM
, for instance, makes require
calls that have a variable rather than a string literal as argument, the converter won't be able to convert it. At any rate, you should have a look at the documentation for details of what could go wrong.