2048 game in ClojureScript
An attempt to build 2048 game in ClojureScript.
Bootstrapping
We’re going to need these things to start coding:
- ClojureScript
- Tailwind
- CIDER for development
First attempt that didn’t work
Use create-reagent-app template like this:
clj -Sdeps '{:deps {seancorfield/clj-new {:mvn/version "1.1.264"}}}' \
-X clj-new/create \
:template '"https://github.com/pavel-popov/create-reagent-app@v0.0.1"' \
:name pvlpp/game2048
Note, make sure you don’t have URL overwrite in your git configuration
(~/.gitconfig
, like I did, so needed to comment out this block:
[url "ssh://git@github.com/"] insteadOf = https://github.com/
Second attempt using repository template
I created a new repo from a template shadow-cljs-template and adjusted packages to latest versions.
To start an app for the first time so it would download all packages and build it run:
npm install
Building CSS with Tailwind
Production build with all unused styles removed:
NODE_ENV=production npm run tw