diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..21b2356 --- /dev/null +++ b/Makefile @@ -0,0 +1,45 @@ +BUILD_DIRECTORY = ".build" + +build: static/main.js + @echo "Building site" + zola build + +static/main.js: $(shell find src) + @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 + +clean: + @echo "Cleaning" + @rm -rf $(BUILD_DIRECTORY) + @rm -rf public + @rm -f static/main.js |