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

fix(preview): #3487 preview should serve latest content by default #3488

Merged

Conversation

Sociosarbis
Copy link
Contributor

@Sociosarbis Sociosarbis commented May 20, 2021

Description

fix #3487

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.

@@ -41,6 +41,7 @@ export async function preview(
config.base,
sirv(distDir, {
etag: true,
dev: !config.isProduction,
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if we shouldn't set dev to true always, since preview is documented as a dev only preview. But I imagine it doesn't hurt to be more efficient if isProduction is true.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think keep this value consistent with the environment would be better. 😄

@patak-dev patak-dev requested a review from antfu May 21, 2021 19:37
@antfu antfu merged commit 9a4183d into vitejs:main May 23, 2021
ygj6 pushed a commit to ygj6/vite that referenced this pull request Jun 1, 2021
…ult (vitejs#3488)

Co-authored-by: fengjianlin <fengjianlin@moyi365.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vite preview responses with initial html although html has been rebuilt
3 participants