Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

fix(schema): disallow setting vite server properties #7317

Merged

Conversation

manniL
Copy link
Member

@manniL manniL commented Sep 7, 2022

πŸ”— Linked issue

nuxt/nuxt#14828

❓ Type of change

  • πŸ‘Œ Enhancement (improving an existing functionality like performance)

πŸ“š Description

Disallows setting the port via vite.server.port in the nuxt.config.ts.
@pi0 Any other options we should disallow? Or vite.server in general?

πŸ“ Checklist

  • I have linked an issue or discussion.

@netlify
Copy link

netlify bot commented Sep 7, 2022

βœ… Deploy Preview for nuxt3-docs canceled.

Name Link
πŸ”¨ Latest commit 7229be7
πŸ” Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/63187fa33ffb9d0008f6a3e1

@pi0 pi0 changed the title chore(types): disallow setting vite server port fix(schema): disallow setting vite server port Sep 7, 2022
@pi0
Copy link
Member

pi0 commented Sep 7, 2022

@pi0 Any other options we should disallow? Or vite.server in general?

I think makes sense to server vite.server to never too πŸ‘πŸΌ (quickly) checking code we are not using it at all.

@pi0 pi0 requested a review from antfu September 7, 2022 11:19
@manniL manniL changed the title fix(schema): disallow setting vite server port fix(schema): disallow setting vite server properties Sep 7, 2022
@pi0 pi0 merged commit ec21019 into nuxt:main Sep 7, 2022
@manniL manniL deleted the chore/adapt-vite-config-types-to-disallow-port branch September 7, 2022 11:26
@nndnha
Copy link

nndnha commented Sep 7, 2022

I want to set Vite build sourcemap option to "hidden" mode so my nuxtConfig was:

vite: {
    build: {
      sourcemap: "hidden",
    },
  },

this PR breaks my config then how can I passed some configurations to Vite with this new change?

@tobiasdiez
Copy link
Contributor

Setting server no never now leads to ts errors for hmr configs that are sometimes necessary (e.g. for gitpod):

vite: {
    server: {
      hmr: ...
    }
}

But hmr is not exposed by the top-level server config. What is the correct config with rc.10?

@pi0
Copy link
Member

pi0 commented Sep 15, 2022

@tobiasdiez Can you please open a PR to limit never to only port/host options? Configuring vite.server.hmr is valid.

@manniL
Copy link
Member Author

manniL commented Sep 15, 2022

@tobiasdiez Can you please open a PR to limit never to only port/host options? Configuring vite.server.hmr is valid.

Will fix this ☺️

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants