Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Feat: add "definePackageConfig" and "defineRootConfig" to make type definition closer to actual work

Aperta
#2,348 0 commenti 2 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
58/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
typescript

Direzione di ricerca

Inizia individuando la definizione del tipo esistente di defineConfig e il punto di ingresso dell’export di vite-plus. Traccia il modo in cui sono rappresentati i tipi di configurazione root e package, quindi verifica che defineRootConfig accetti opzioni solo per root, mentre definePackageConfig le rifiuti; controlla anche le indicazioni proposte per la deprecazione di defineConfig.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

pending triage
Description

current, defineConfig type definition allow to write root only option(e.g. run.enablePrePostScripts) to package. but actually, it does not works. this problem is not good of developer experience.

Suggested solution

Add "definePackageConfig" and "defineRootConfig" function. this will be exported by "vite-plus". "defineRootConfig" is just alias of "defineConfig" but "definePackageConfig" has new type definition.

code example
// workspace/packages/main/vite.config.ts
// this is package's config file.
import { definePackageConfig } from "vite-plus"

export default definePackageConfig({
  run: {
    enablePrePostScripts:true // happen type error because run.enablePrePostScripts is root only option
  }
})
// workspace/vite.config.ts
// this is root's config.
import { defineRootConfig } from "vite-plus"

export default defineRootConfig({
  run: {
    enablePrePostScripts:true // does not happen type error.
  }
})

also, this is just coding rules. no one can stop to use "defineConfig" or "defineRootConfig" in package's vite.config.ts.
this proposal make "defineConfig" deprecated and recommend use new function.

Alternative

Add more readable jsdoc e.g. "@root-only - this option does not work on package's config". but probably, developer will fail to notice.

Additional context

No response

Validations
  • Read the Contributing Guidelines.
  • Confirm this request is for Vite+ itself and not for Vite, Vitest, tsdown, Rolldown, or Oxc.
  • Check that there isn't already an issue requesting the same feature.
Lingua principale
Rust
Stelle
5.8k
Fork
263
Merge medio
21h 13m
PR unite (30g)
146

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di voidzero-dev/vite-plus

Tutte le issue di voidzero-dev/vite-plus

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.