feat: 修改main路径,增加打包静态资源

This commit is contained in:
zhengkunwang223
2022-10-17 16:32:31 +08:00
committed by zhengkunwang223
parent 5f5a48041b
commit 115b75c1cb
120 changed files with 1357 additions and 414 deletions

22
Makefile Normal file
View File

@@ -0,0 +1,22 @@
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOARCH=$(shell go env GOARCH)
GOOS=$(shell go env GOOS )
BASE_PAH := $(shell pwd)
BUILD_PATH = $(BASE_PAH)/build
WEB_PATH=$(BASE_PAH)/frontend
SERVER_PATH=$(BASE_PAH)/backend
MAIN= $(BASE_PAH)/cmd/server/main.go
APP_NAME=1panel
build_web:
cd $(WEB_PATH) && npm install && npm run build:dev
build_bin:
cd $(SERVER_PATH) \
&& GOOS=$(GOOS) GOARCH=$(GOARCH) $(GOBUILD) -trimpath -ldflags "-s -w" -o $(BUILD_PATH)/$(APP_NAME) $(MAIN)
build_all: build_web build_bin