最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

remix.run - Remix start command vs dev command - Stack Overflow

programmeradmin4浏览0评论

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?

Share Improve this question edited 1 hour ago Barmar 781k56 gold badges545 silver badges659 bronze badges asked 2 hours ago Chen PelegChen Peleg 2,0841 gold badge19 silver badges34 bronze badges
Add a comment  | 

1 Answer 1

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.

发布评论

评论列表(0)

  1. 暂无评论