diff options
author | Joris | 2020-02-13 18:54:18 +0100 |
---|---|---|
committer | Joris | 2020-02-15 10:59:25 +0100 |
commit | 7a01b001ccc4a7bda3da92486903540e3f9754fd (patch) | |
tree | fbe269faa319fd7f21049612f8a62c0c169f369e /Makefile | |
parent | 8328c11ac6706e3adf9b09877c02897132b8927a (diff) |
Set up bucklescript
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 51 |
1 files changed, 15 insertions, 36 deletions
@@ -1,45 +1,24 @@ -BUILD_DIRECTORY = ".build" +export PATH := node_modules/.bin:$(PATH) build: static/main.js @echo "Building site" - zola build + @zola build -static/main.js: $(shell find src) +static/main.js: node_modules $(shell find src \( -type d -o \( -type f -a -regex ".*\.ml" \) \)) @echo "Building $@" -ifeq ($(DEV_MODE), true) - @tsc \ - --strict \ - --noUnusedLocals \ - --noUnusedParameters \ - --noImplicitReturns \ - --outDir $(BUILD_DIRECTORY) \ - --module es2015 \ - src/main.ts - @rollup \ - --input $(BUILD_DIRECTORY)/main.js \ - --file $@ \ - --format iife -else - @tsc \ - --strict \ - --noUnusedLocals \ - --noUnusedParameters \ - --noImplicitReturns \ - --outDir $(BUILD_DIRECTORY) \ - --module es2015 \ - src/main.ts - @rollup \ - --input $(BUILD_DIRECTORY)/main.js \ - --file $@ \ - --format iife - @terser $@ \ - --output $@ \ - --compress \ - --mangle -endif + @bsb -make-world + @rollup --config rollup.config.js + @terser $@ --output $@ --compress --mangle + +node_modules: package.json + @bsb -init init + @mv init/node_modules . + @rm -rf init + @npm install + @touch -c node_modules clean: @echo "Cleaning" - @rm -rf $(BUILD_DIRECTORY) - @rm -rf public @rm -f static/main.js + @rm -rf node_modules lib + @find src -name '*.bs.js' -exec rm {} \; |