1

I started a Remix tutorial from this link

Basically just ran

npx create-remix@latest

And followed the instructions.

Now in my package.json I see:

 "scripts": {
 "build": "remix vite:build",
 "dev": "remix vite:dev",
 "lint": "eslint --ignore-path .gitignore --cache --cache-location 
 ./node_modules/.cache/eslint .",
 "start": "remix-serve ./build/server/index.js",
 "typecheck": "tsc"
 },

I know Vite well, so I understand the dev command, as starting a dev server.

I'd like to know as a Remix newbie (couldn't find a simple answer in the docs):

What is the purpose of the start command, and its relation to the dev command?

Barmar
789k57 gold badges555 silver badges669 bronze badges
asked Feb 10 at 8:56

1 Answer 1

1

The start command starts serving your build from ./build directory using a built-in Remix App Server.

That build should be previously created with the build command.

So the purpose is to run a (production) build.

Remix encourages you to bring your own server, e.g. Express or whatever you prefer. Then you could modify the start command as follows:

"start": "cross-env NODE_ENV=production node ./build/server/index.js"
answered Feb 11 at 10:29
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.