4 ms·
Does this mean I could use compile and then require clojurescript modules in node? Today I use babel to "transpile" es2015 to es5 and then load those in, could
by netcraft 11y ago
Does this mean I could use compile and then require clojurescript modules in node? Today I use babel to "transpile" es2015 to es5 and then load those in, could I do something similar with clojurescript?
- mfikes 11y agoNone of this recent work facilitates compiling ClojureScript into CommonJS modules for use with Node. But, the opposite is in flight: ClojureScript now has support for depending on libraries that are packaged using the CommonJS system.
- klibertp 11y ago> None of this recent work facilitates compiling ClojureScript into CommonJS modules for use with Node. http://www.matthewstump.com/misc/2012/06/04/writing-nodejs-modules-in-clojurescript/ http://www.matthewstump.com/misc/2012/06/04/writing-nodejs-m... Should be really very easy to do, you only need to study what cljs compiler emits and the docs for Google Closure Compiler JS libs.
- raju 11y agoCan someone this to me? It seems that mfikes (parent) comment, and klibertp's comment seem to contradict each other. Not to mention the examples that glenjamin highlighted. I have heard similar comments in other places, in that it's not possible to package ClojureScript as a NPM module. Is it because of the size of the module, or something else?
- glenjamin 11y agoThis was already possible, see https://github.com/swannodette/mori https://github.com/swannodette/mori or https://github.com/glenjamin/checkers https://github.com/glenjamin/checkers for examples.