diff options
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 {} \; |