Make

We use the old school GNU Make to manage shell entry points in LeanJS. You may prefer to use Gulp, Grunt, or some other task manager, but we don’t see any feature that we need and that Make does not provide.

It has the advantage to be understandable by non-javascript persons, including ops, and we use it to provide a language agnostic interface to our projects (we provide the same commands whether the project is written using javascript, python, ruby, java, php, ...).

The pros may be not very important for you, feel free to change the way you manage this.

Targets

start (default)

Usage: make start or make

Throws up a development server (see Server).

# Start a development server.
# You need to run "npm install" before that.
start:
	npm run start

build

Usage: make build

Compiles a production ready build in the build folder.

# Builds a production-ready release, under /build.
# It will be self contained, and it's the base of the docker image.
build:
	npm run build

install

Usage: make install

Wraps npm install, installs all project dependencies under node_modules, including development dependencies.

# Install dependencies (dev + prod)
install:
	npm install