Skip to content

henryw374/cljs-node-foreign-lib-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 

Repository files navigation

Demo of how umd foreign-libs behave on node

TL;DR - not a good idea

Run the Demo

clj -m cljs.main -co '{:foreign-libs [{:file "my-foreign-lib.js" :provides ["my.foreignlib"]}]}'  -c test -re node  --repl

Once the repl starts

(require 'my.foreignlib)

Note that the 'node' test of the umd module fails, ie this bit: typeof exports === 'object' && typeof module !== 'undefined'

so it prints out 'not node?'

Now, do the require again:

(require 'my.foreignlib)

and see that the foreign lib script is re-run.

About

running clojurescript on node, foreign libs might not work as you thought

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published