Skip to content

minimal-xyz/minimal-shadow-cljs-commonjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example for shadow-cljs

Usage

Compile ClojureScript into CommonJS JavaScript:

yarn
yarn compile

Browse target/ folder to see the results. You can check CommonJS result with node:

$ node
> require('./target/example.main').main()
App loaded!
null
>
Advanced

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
>

Steps

To setup in a new project:

  • yarn add --dev shadow-cljs
  • configure shadow-cljs.edn
  • compile with commands
For release mode

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.

License

MIT

Releases

No releases published

Packages

No packages published