From 7d04d53d02e22f9f0966ac850add885b82c845e0 Mon Sep 17 00:00:00 2001 From: Ivan Li Date: Mon, 3 May 2021 12:03:18 +0800 Subject: [PATCH] build: use pm2 serve for prod. --- ecosystem.config.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ecosystem.config.js b/ecosystem.config.js index 10e4eb0..ce4759e 100644 --- a/ecosystem.config.js +++ b/ecosystem.config.js @@ -3,11 +3,16 @@ module.exports = { { name: "blog-bs", script: "serve", - args: "-s build", + args: "", watch: false, ignore_watch: ["node_modules"], log_date_format: "MM-DD HH:mm:ss.SSS Z", - env: {}, + env: { + PM2_SERVE_PATH: "./build", + PM2_SERVE_PORT: 7135, + PM2_SERVE_SPA: "true", + PM2_SERVE_HOMEPAGE: "/index.html", + }, max_restarts: 5, }, ],