aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJoris2020-02-03 18:28:50 +0100
committerJoris2020-02-03 18:28:50 +0100
commitcbcc269be607cc964fbd69d179d8a0e8b8e4bffa (patch)
tree7a8135f7ede7e1ff02bc1cf1d697a8c39a56e962 /Makefile
parentc7e20a6dd01a2ae049c451d18511708aaee60a19 (diff)
downloadcooking-cbcc269be607cc964fbd69d179d8a0e8b8e4bffa.tar.gz
cooking-cbcc269be607cc964fbd69d179d8a0e8b8e4bffa.tar.bz2
cooking-cbcc269be607cc964fbd69d179d8a0e8b8e4bffa.zip
Extract dom and number utilities to external files
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile45
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