Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update env-and-mode.md to fix default modes #4928

Merged
merged 1 commit into from
Sep 24, 2021

Conversation

matbarker
Copy link
Contributor

Description

As per this pull request #4483, the default mode for preview is now production

Additional context


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the Commit Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

As per this pull request -- vitejs#4483 --, the default mode for `preview` is now `production`
haoqunjiang
haoqunjiang previously approved these changes Sep 14, 2021
@haoqunjiang haoqunjiang changed the title Update env-and-mode.md to fix default modes docs: update env-and-mode.md to fix default modes Sep 14, 2021
@patak-dev
Copy link
Member

Isnt the command for dev called serve?

.alias('serve')

@haoqunjiang
Copy link
Member

That's somehow confusing 😂 I thought the documentation refers to the npm run serve command at my first glance.

@patak-dev
Copy link
Member

Isnt it referring to that? I'm more confused now 😅

@haoqunjiang
Copy link
Member

😅 I'm more than confused now.

So does this statement actually mean:

By default, the dev server (vite / vite serve / npm run dev) runs in development mode, and the build and serve commands (vite build / npm run build and vite preview / npm run serve) run in production mode.

@haoqunjiang haoqunjiang dismissed their stale review September 14, 2021 13:15

I'm confused so let's discuss further

@haoqunjiang
Copy link
Member

Or, to better organize it, we can change the documentation to:

By default:

  • vite / vite serve / npm run dev (the dev server) runs in development mode;
  • vite build / npm run build (the build command) runs in production mode.
  • vite preview / npm run serve (the preview server) runs in production mode.

@patak-dev
Copy link
Member

That would be definitely more clear, and I see now why I was confused by this (again)

I would prefer that we deprecate npm vite serve in favour of vite dev. It is really confusing that npm run serve is not calling vite serve. Or we could change serve to another word, given that we can't use preview here

@haoqunjiang
Copy link
Member

Yeah I agree.

@Shinigami92 Shinigami92 added the documentation Improvements or additions to documentation label Sep 14, 2021
@ar7casper ar7casper mentioned this pull request Sep 19, 2021
9 tasks
Copy link
Member

@patak-dev patak-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We decided to deprecate vite serve and rename it to vite dev. So we can merge this one now, I'll do another PR later

@patak-dev patak-dev merged commit 6011665 into vitejs:main Sep 24, 2021
aleclarson pushed a commit to aleclarson/vite that referenced this pull request Nov 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants