Skip to content

Commit

Permalink
feat: made domains configurable, removed locales configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
BowlingX committed Apr 4, 2023
1 parent 46ff63d commit fc12733
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/server/serve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const publicClientDirectory = path.join(staticDirectory, 'client')

type ServingOptions = Pick<
ServerOptions,
'locale' | 'assetPrefix' | 'linkPrefix' | 'outputMode'
'locale' | 'assetPrefix' | 'linkPrefix' | 'outputMode' | 'domains'
>
type ServingOptionsCb =
| ServingOptions
Expand Down
4 changes: 2 additions & 2 deletions src/shell/app-shell.server.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ export default async function (
defaultLocale,
locale: options.locale || defaultLocale,
assetPrefix: options.assetPrefix,
locales: options.locales || locales,
locales,
basePath,
domains,
domains: options.domains || domains,
nodeEnv: options.nodeEnv,
linkPrefix: options.linkPrefix,
query: options.query,
Expand Down
10 changes: 6 additions & 4 deletions src/types/entrypoint.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ComponentType } from 'react'
import { DomainLocale, I18NConfig } from 'next/dist/server/config-shared.js'
import { DomainLocale } from 'next/dist/server/config-shared.js'
import { ParsedUrlQuery } from 'querystring'

export interface WrapperProps {
Expand Down Expand Up @@ -28,8 +28,8 @@ export type ServerOptions = {
/** path to all assets */
publicPath: string
outputMode?: OutputMode
domains?: DomainLocale[]
locale?: string
locales?: Partial<I18NConfig>['locales']
assetPrefix?: string
linkPrefix?: string
query?: ParsedUrlQuery
Expand All @@ -40,8 +40,10 @@ export type NextStaticData = {
context: Record<string, unknown>
publicAssetPath: string
locales?: string[]
domains?: DomainLocale[]
basePath?: string
defaultLocale?: string
query?: ParsedUrlQuery
} & Pick<ServerOptions, 'locale' | 'assetPrefix' | 'nodeEnv' | 'linkPrefix'>
} & Pick<
ServerOptions,
'domains' | 'locale' | 'assetPrefix' | 'nodeEnv' | 'linkPrefix'
>

0 comments on commit fc12733

Please sign in to comment.