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?
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?
1 Answer
Reset to default -2"Hola, entiendo tu duda. El mandato start en el contexto de Remix generalmente se utiliza para ejecutar la versión construida de la aplicación en un entorno de producción. Es decir, inicia el servidor con los archivos generados después de ejecutar build. Por otro lado, el mandato dev se usa durante el desarrollo para iniciar un servidor que recarga automáticamente los cambios realizados en el código.
En resumen:
dev: Ideal para desarrollo, permite trabajar con actualizaciones en tiempo real.
start: Usado en producción, ejecuta la aplicación con los archivos ya compilados.