From f7cbba7a11a085e8132b8a8ded6162ab26b8c4e3 Mon Sep 17 00:00:00 2001 From: jarves Date: Fri, 19 Aug 2022 01:52:05 -0500 Subject: [PATCH] build: small fixes - fixes 'GOROOT' with space in path - fixes glob.sync breaking on windows path slash - fix makefile color printing Signed-off-by: jarves --- makefile | 10 +++++----- vite.config.js | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/makefile b/makefile index 141844f025..665420d4d5 100644 --- a/makefile +++ b/makefile @@ -48,7 +48,7 @@ $(OUT_DIR)/bundle/.dirstamp: \ touch $@ $(OUT_DIR)/sim_worker.js: ui/worker/sim_worker.js - cat $(GOROOT)/misc/wasm/wasm_exec.js > $(OUT_DIR)/sim_worker.js + cat '$(GOROOT)/misc/wasm/wasm_exec.js' > $(OUT_DIR)/sim_worker.js cat ui/worker/sim_worker.js >> $(OUT_DIR)/sim_worker.js $(OUT_DIR)/net_worker.js: ui/worker/net_worker.js @@ -111,9 +111,9 @@ wasm: $(OUT_DIR)/lib.wasm $(OUT_DIR)/lib.wasm: sim/wasm/* sim/core/proto/api.pb.go $(filter-out sim/core/items/all_items.go, $(call rwildcard,sim,*.go)) @echo "Starting webassembly compile now..." @if GOOS=js GOARCH=wasm go build -o ./$(OUT_DIR)/lib.wasm ./sim/wasm/; then \ - echo "\033[1;32mWASM compile successful.\033[0m"; \ + printf "\033[1;32mWASM compile successful.\033[0m\n"; \ else \ - echo "\033[1;31mWASM COMPILE FAILED\033[0m"; \ + printf "\033[1;31mWASM COMPILE FAILED\033[0m\n"; \ exit 1; \ fi @@ -146,9 +146,9 @@ wowsimwotlk: binary_dist devserver devserver: sim/core/proto/api.pb.go sim/web/main.go binary_dist/dist.go @echo "Starting server compile now..." @if go build -o wowsimwotlk ./sim/web/main.go; then \ - echo "\033[1;32mBuild Completed Succeessfully\033[0m"; \ + printf "\033[1;32mBuild Completed Succeessfully\033[0m\n"; \ else \ - echo "\033[1;31mBUILD FAILED\033[0m"; \ + printf "\033[1;31mBUILD FAILED\033[0m\n"; \ exit 1; \ fi diff --git a/vite.config.js b/vite.config.js index 21f8db1144..ddbce59b16 100644 --- a/vite.config.js +++ b/vite.config.js @@ -11,7 +11,7 @@ export default defineConfig(({ command, mode }) => ({ sourcemap: command === "serve" ? "inline" : "false", target: ["es2020"], rollupOptions: { - input: glob.sync(path.resolve(__dirname, "ui", "**/index.html")), + input: glob.sync(path.resolve(__dirname, "ui", "**/index.html").replace(/\\/g, "/")), output: { assetFileNames: () => "bundle/[name]-[hash].style.css", entryFileNames: () => "bundle/[name]-[hash].entry.js",