Example for shadow-cljs
Compile ClojureScript into CommonJS JavaScript:
yarn
yarn compileBrowse target/ folder to see the results. You can check CommonJS result with node:
$ node
> require('./target/example.main').main()
App loaded!
null
>Watch and compile:
$ yarn shadow-cljs watch app
$ node
> require('./target/example.main').main()
App loaded!
null
>Compiled with dead code eliminations:
$ yarn shadow-cljs release app
$ node
> require('./target/release/example.main').main()
App loaded!
null
>
To setup in a new project:
yarn add --dev shadow-cljs- configure
shadow-cljs.edn - compile with commands
Notice that in release, in order to build in :advanced, :entries is required:
{; ...
:release {:entries [example.main]
:output-dir "target/release/"}}And configs of :release will overwrite previous configs.
MIT