Skip to content
This repository was archived by the owner on Apr 6, 2023. It is now read-only.
/frameworkPublic archive

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

Merged
pi0 merged 6 commits into
nuxt:mainfrom
TheAlexLichter:chore/adapt-vite-config-types-to-disallow-port
Sep 7, 2022
Merged

fix(schema): disallow setting vite server properties#7317
pi0 merged 6 commits into
nuxt:mainfrom
TheAlexLichter:chore/adapt-vite-config-types-to-disallow-port

Conversation

@TheAlexLichter

Copy link
Copy Markdown
Member

🔗 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

netlifyBot commented Sep 7, 2022

Copy link
Copy Markdown

Deploy Preview for nuxt3-docs canceled.

NameLink
🔨 Latest commit7229be7
🔍 Latest deploy loghttps://app.netlify.com/sites/nuxt3-docs/deploys/63187fa33ffb9d0008f6a3e1

@pi0pi0 changed the title chore(types): disallow setting vite server portfix(schema): disallow setting vite server portSep 7, 2022
@pi0

pi0 commented Sep 7, 2022

Copy link
Copy Markdown
Member

@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 antfuSeptember 7, 2022 11:19
@TheAlexLichterTheAlexLichter changed the title fix(schema): disallow setting vite server portfix(schema): disallow setting vite server propertiesSep 7, 2022
pi0
pi0 approved these changes Sep 7, 2022
@pi0
pi0 merged commit ec21019 into nuxt:mainSep 7, 2022
@TheAlexLichter
TheAlexLichter deleted the chore/adapt-vite-config-types-to-disallow-port branch September 7, 2022 11:26
@nndnha

Copy link
Copy Markdown

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?

This was referenced Sep 8, 2022
@tobiasdiez

Copy link
Copy Markdown
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

pi0 commented Sep 15, 2022

Copy link
Copy Markdown
Member

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

@TheAlexLichter

Copy link
Copy Markdown
MemberAuthor

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

Will fix this ☺️

@pi0pi0 mentioned this pull request Sep 15, 2022
Sign up for freeto 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

@TheAlexLichter@pi0@nndnha@tobiasdiez@danielroe