From c6f691d86b5e1706a27fd61c5e8fa1160305ae5f Mon Sep 17 00:00:00 2001 From: Josip Igrec Date: Tue, 6 Oct 2020 03:23:21 +0200 Subject: [PATCH] Make build/prod deploy a bit more smooth --- .gitignore | 1 + Makefile | 6 +++++- nuxt.config.build.js | 7 +++++++ 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 nuxt.config.build.js diff --git a/.gitignore b/.gitignore index d6d243f..d1e7a26 100644 --- a/.gitignore +++ b/.gitignore @@ -67,6 +67,7 @@ typings/ # nuxt.js temp build output .nuxt +.nuxt.tmp # nuxt.js prod build output .nuxt-prod diff --git a/Makefile b/Makefile index 75b6248..5d1312a 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,8 @@ NODE_MODULES := ./node_modules DB_CONTAINER := meetup-db WEB_CONTAINER := nuxt +BUILD_OUTPUT_DIR := .nuxt.tmp +FINAL_OUTPUT_DIR := .nuxt .PHONY: stop start up up-db up-web prod dev down down-web restart restart-web reboot reboot-web rebuild install yarn-install build clean build-containers @@ -40,7 +42,9 @@ yarn-install: docker/yarn install build: yarn-install - docker/yarn build + docker/yarn build -c nuxt.config.build + rm -rf "$(FINAL_OUTPUT_DIR)" + mv "$(BUILD_OUTPUT_DIR)" "$(FINAL_OUTPUT_DIR)" clean: rm -rf $(NODE_MODULES) .nuxt diff --git a/nuxt.config.build.js b/nuxt.config.build.js new file mode 100644 index 0000000..c924131 --- /dev/null +++ b/nuxt.config.build.js @@ -0,0 +1,7 @@ +import baseConfig from "./nuxt.config"; + +export default { + ...baseConfig, + + buildDir: ".nuxt.tmp", +};