Skip to content
This repository has been archived by the owner on Oct 28, 2019. It is now read-only.

Commit

Permalink
Update makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
rl-king committed Jul 3, 2019
1 parent 65445d1 commit 10ed6c1
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,24 @@ ELM_FILES = $(shell find src -name '*.elm')
SHELL := /bin/bash
NPM_PATH := ./node_modules/.bin
ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
DIST_DIR := ./lib/dist

export PATH := $(NPM_PATH):$(PATH)

all: $(ELM_FILES)
@yes | elm make src/Main.elm --output dist/main.js
all: elm

analyse: deps
@elm-analyse --elm-format-path=./node_modules/elm-format/bin/elm-format src
analyse:
@elm-analyse --serve --elm-format-path=./node_modules/elm-format/bin/elm-format src

clean:
@rm -Rf dist/*

elm:
@elm make src/Main.elm --output dist/main.js

elmoptimized:
@elm make --optimize src/Main.elm --output dist/main.js

deps:
@npm install

Expand Down Expand Up @@ -48,8 +54,11 @@ help:
@echo " test Run Elm-test"
@echo " watch Run 'make all' on Elm file change"

minify:
@npx uglify-js ${DIST_DIR}/main.js --compress 'pure_funcs="F2,F3,F4,F5,F6,F7,F8,F9,A2,A3,A4,A5,A6,A7,A8,A9",pure_getters,keep_fargs=false,unsafe_comps,unsafe' | npx uglify-js --mangle --output=${DIST_DIR}/main.js\

test:
@elm-test
@elm-test --compiler ${ROOT_DIR}/node_modules/.bin/elm

watch:
@find src -name '*.elm' | entr make all
find src -name '*.elm' | entr make all

0 comments on commit 10ed6c1

Please sign in to comment.