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

Commit

Permalink
fix(schema): only disallow vite server port and host (#7554)
Browse files Browse the repository at this point in the history
  • Loading branch information
manniL committed Sep 15, 2022
1 parent 4b4558c commit 1f3d9a1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/schema/src/types/config.ts
@@ -1,6 +1,6 @@
import type { KeepAliveProps, TransitionProps } from 'vue'
import { ConfigSchema } from '../../schema/config'
import type { UserConfig as ViteUserConfig } from 'vite'
import type { ServerOptions as ViteServerOptions, UserConfig as ViteUserConfig } from 'vite'
import type { Options as VuePluginOptions } from '@vitejs/plugin-vue'
import type { MetaObject } from './meta'
import type { Nuxt } from './nuxt'
Expand Down Expand Up @@ -53,19 +53,19 @@ export interface ViteConfig extends ViteUserConfig {
/**
* Use environment variables or top level `server` options to configure Nuxt server.
*/
server?: never
server?: Omit<ViteServerOptions, 'port' | 'host'>
}


// -- Runtime Config --

type RuntimeConfigNamespace = Record<string, any>

export interface PublicRuntimeConfig extends RuntimeConfigNamespace {}
export interface PublicRuntimeConfig extends RuntimeConfigNamespace { }

// TODO: remove before release of 3.0.0
/** @deprecated use RuntimeConfig interface */
export interface PrivateRuntimeConfig extends RuntimeConfigNamespace {}
export interface PrivateRuntimeConfig extends RuntimeConfigNamespace { }

export interface RuntimeConfig extends PrivateRuntimeConfig, RuntimeConfigNamespace {
public: PublicRuntimeConfig
Expand All @@ -88,4 +88,4 @@ export interface NuxtAppConfig {
keepalive: boolean | KeepAliveProps
}

export interface AppConfig {}
export interface AppConfig { }

2 comments on commit 1f3d9a1

@FarhanShares
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you please describe why it needs to be disabled?

I'm not boot up dev server due to the server?: Omit<ViteServerOptions, 'port' | 'host'>
May I know how can I apply my specific needs?

@FarhanShares
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, this wasn't the issue actually. Here's a relevant issue that also has a wrokaround for now and to be fixed soon.
https://github.com/nuxt/framework/issues/7828#issuecomment-1259204564

Sorry to bother here, after I got a breaking change in the nuxt.config.ts, I was looking into the changes thinking it might not have documented yet.

Please sign in to comment.