/HTMLButtonElement-in-Space

My entry for JS13K 2021

Primary LanguageNixBSD 4-Clause "Original" or "Old" LicenseBSD-4-Clause

js13k template

with parcel (and nix flake)

Setup

There is 2 (4 if you count pnpm and yarn) way to setup.

using npm

In this approach, no linter or formatter are installed. Only parcel.

Install all dependencies via:

npm install

then you can run the project using:

npx parcel serve index.html

or build for production using:

# for browser bundle
npx parcel build index.html --target {desktop,mobile,xr} # choose one

# build to run in nodejs (server), not browser
npx parcel build server.ts --target server

using nix (experimental)

This require nix flake to be enabled. This approach will automatically install both project dependencies and all toolchains like linter, formatter, and nodejs.

TOFU: Supply all (or one of the platform) sha256 first before running any nix command.

dev environment

Run this once or twice to enter the development environment.

nix develop

TODO: build for production

You can build for all target:

nix build

or specify which target to build:

nix build '.#desktop' # or '.#mobile' or '.#xr' or '.#server'

cleanup

In case unexpected things happen.

rm .parcel-cache/ dist/ node_modules/ -fr
rm package-lock.json yarn.lock pnpm-lock.yaml -f