Description
It would be nice if we can provide input suggestions for
- the config:
export default defineConfig({
environments: {
s
^^^ input suggestion here
}
})
- codes in meta-frameworks:
server.environments.s
^^^ input suggestion here
Suggested solution
Add the KnownEnvironment type that lists the known environment names
// this `Record<string & {}, never>` is to force the value of extended keys to be `never`
interface KnownEnvironment extends Record<string & {}, never> {
client: never
ssr: never
}
type KnownEnvironmentNames = keyof KnownEnvironment
type Environments = Partial<Record<KnownEnvironmentNames, string>>
Plugins / Meta-frameworks can extend by:
declare module 'vite' {
interface KnownEnvironment {
myEnv: never
}
}
Alternative
No response
Additional context
This is also useful for vitejs/ecosystem#10
Validations
Description
It would be nice if we can provide input suggestions for
Suggested solution
Add the
KnownEnvironmenttype that lists the known environment namesPlugins / Meta-frameworks can extend by:
Alternative
No response
Additional context
This is also useful for vitejs/ecosystem#10
Validations