feat(dev): add air live-reload with make watch
This commit is contained in:
@@ -0,0 +1,18 @@
|
|||||||
|
root = "."
|
||||||
|
tmp_dir = "tmp"
|
||||||
|
|
||||||
|
[build]
|
||||||
|
bin = "./tmp/nib"
|
||||||
|
cmd = "go build -o ./tmp/nib ."
|
||||||
|
args_bin = ["serve"]
|
||||||
|
delay = 500
|
||||||
|
exclude_dir = ["tmp", "testdata", "docs"]
|
||||||
|
exclude_regex = ["_test\\.go$"]
|
||||||
|
include_ext = ["go", "html", "css", "js", "svg"]
|
||||||
|
kill_delay = 500
|
||||||
|
|
||||||
|
[log]
|
||||||
|
time = false
|
||||||
|
|
||||||
|
[misc]
|
||||||
|
clean_on_exit = true
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
# Binary
|
# Binary
|
||||||
nib
|
nib
|
||||||
|
tmp/
|
||||||
|
|
||||||
# Database
|
# Database
|
||||||
*.db
|
*.db
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ BINARY := nib
|
|||||||
MODULE := github.com/lerko/nib
|
MODULE := github.com/lerko/nib
|
||||||
GOFLAGS := -trimpath
|
GOFLAGS := -trimpath
|
||||||
|
|
||||||
.PHONY: build dev test lint fmt vet clean run help
|
.PHONY: build dev watch test lint fmt vet clean run help
|
||||||
|
|
||||||
## —— Build ——————————————————————————————————
|
## —— Build ——————————————————————————————————
|
||||||
|
|
||||||
@@ -12,6 +12,9 @@ build: ## Build production binary
|
|||||||
dev: ## Build and run with default serve
|
dev: ## Build and run with default serve
|
||||||
go run . serve
|
go run . serve
|
||||||
|
|
||||||
|
watch: ## Live-reload dev server (requires air)
|
||||||
|
air
|
||||||
|
|
||||||
## —— Quality ————————————————————————————————
|
## —— Quality ————————————————————————————————
|
||||||
|
|
||||||
test: ## Run all tests
|
test: ## Run all tests
|
||||||
|
|||||||
Reference in New Issue
Block a user