From fde4506533a1619fa1da3980a0cf06951ed6b95a Mon Sep 17 00:00:00 2001 From: Michael Jackson Date: Wed, 10 Mar 2021 16:04:28 -0800 Subject: [PATCH] Update to Remix 0.14 --- .gitignore | 1 + package.json | 10 +++++----- pm2.config.js | 16 ++++++++-------- server.js | 1 + 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index 793199f..23a0e3a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ node_modules/ package-lock.json +/.cache /build /public/build diff --git a/package.json b/package.json index 94d6efd..b45ec22 100644 --- a/package.json +++ b/package.json @@ -1,17 +1,16 @@ { "private": true, "name": "remix-starter-express", - "version": "1.0.0", "scripts": { + "postinstall": "remix build", "build": "remix build", "dev": "pm2-dev pm2.config.js", "start": "node server.js" }, "dependencies": { - "@remix-run/cli": "^0.13.0", - "@remix-run/data": "^0.13.0", - "@remix-run/express": "^0.13.0", - "@remix-run/react": "^0.13.0", + "@remix-run/data": "^0.14.0", + "@remix-run/express": "^0.14.0", + "@remix-run/react": "^0.14.0", "compression": "^1.7.4", "express": "^4.17.1", "morgan": "^1.10.0", @@ -21,6 +20,7 @@ "react-router-dom": "^6.0.0-beta.0" }, "devDependencies": { + "@remix-run/dev": "^0.14.0", "@types/react": "^17.0.1", "@types/react-dom": "^17.0.0", "pm2": "^4.5.4", diff --git a/pm2.config.js b/pm2.config.js index 80f961f..6fa9094 100644 --- a/pm2.config.js +++ b/pm2.config.js @@ -3,21 +3,21 @@ module.exports = { { name: "Express", script: "server.js", - watch: ["remix.config.js", "app"], + watch: ["build/assets.json"], watch_options: { - followSymlinks: false, + followSymlinks: false }, env: { - NODE_ENV: "development", - }, + NODE_ENV: "development" + } }, { name: "Remix", script: "remix run", ignore_watch: ["."], env: { - NODE_ENV: "development", - }, - }, - ], + NODE_ENV: "development" + } + } + ] }; diff --git a/server.js b/server.js index ab04b21..79a7e77 100644 --- a/server.js +++ b/server.js @@ -20,6 +20,7 @@ if (process.env.NODE_ENV === "development") { app.all( "*", createRequestHandler({ + build: require("./build"), getLoadContext() { // Whatever you return here will be passed as `context` to your loaders // and actions.