diff --git a/Makefile b/Makefile index 94d47c4..58f4aaf 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,19 @@ -build: +all: uglify | build + +uglify: yarn yarn uglify - shards install + +build: libs crystal build src/mango.cr --release --progress + +libs: + shards install + run: crystal run src/mango.cr --error-trace + clean: - rm mango rm -rf dist rm yarn.lock rm -rf node_modules diff --git a/src/static_handler.cr b/src/static_handler.cr index 6e41fab..890683a 100644 --- a/src/static_handler.cr +++ b/src/static_handler.cr @@ -5,7 +5,11 @@ require "./util" class FS extend BakedFileSystem - bake_folder "../dist" + {% if read_file? "./dist" %} + bake_folder "../dist" + {% else %} + bake_folder "../public" + {% end %} end class StaticHandler < Kemal::Handler