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

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

Merged
pi0 merged 6 commits intonuxt: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 intonuxt: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
Copy link
Copy Markdown

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
Copy Markdown
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
@TheAlexLichter TheAlexLichter 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
@TheAlexLichter TheAlexLichter deleted the chore/adapt-vite-config-types-to-disallow-port branch September 7, 2022 11:26
@nndnha
Copy link
Copy Markdown

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

@TheAlexLichter
Copy link
Copy Markdown
Member Author

@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