mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-31 07:40:33 +00:00
fix(schema): warn if user provides vite.publicDir
(#21847)
This commit is contained in:
parent
52a427d583
commit
381e0f8349
@ -30,7 +30,12 @@ export default defineUntypedSchema({
|
||||
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue']
|
||||
},
|
||||
publicDir: {
|
||||
$resolve: async (val, get) => val ?? resolve((await get('srcDir')), (await get('dir')).public)
|
||||
$resolve: async (val, get) => {
|
||||
if (val) {
|
||||
console.warn('Directly configuring the `vite.publicDir` option is not supported. Instead, set `dir.public`. You can read more in `https://nuxt.com/docs/api/configuration/nuxt-config#public`.')
|
||||
}
|
||||
return val ?? resolve((await get('srcDir')), (await get('dir')).public)
|
||||
}
|
||||
},
|
||||
vue: {
|
||||
isProduction: {
|
||||
|
@ -96,7 +96,7 @@ export interface NuxtOptions extends Omit<ConfigSchema, 'builder'> {
|
||||
$schema: SchemaDefinition
|
||||
}
|
||||
|
||||
export interface ViteConfig extends ViteUserConfig {
|
||||
export interface ViteConfig extends Omit<ViteUserConfig, 'publicDir'> {
|
||||
/** The path to the entrypoint for the Vite build. */
|
||||
entry?: string
|
||||
/**
|
||||
@ -126,6 +126,14 @@ export interface ViteConfig extends ViteUserConfig {
|
||||
* Use environment variables or top level `server` options to configure Nuxt server.
|
||||
*/
|
||||
server?: Omit<ViteServerOptions, 'port' | 'host'>
|
||||
/**
|
||||
* Directly configuring the `vite.publicDir` option is not supported. Instead, set `dir.public`.
|
||||
*
|
||||
* You can read more in <https://nuxt.com/docs/api/configuration/nuxt-config#public>.
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
publicDir?: never
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user