Skip to content

Commit

Permalink
fix: url should be optional in dev
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Feb 7, 2024
1 parent d6ae4da commit 9eb9b76
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion layers/core/cli/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function createCLI(opts: DocsCLIOptions = {}) {
},
args: { ...sharedArgs },
async setup({ args }) {
const { appDir, nuxtConfig } = await setupDocs(args.dir, opts.setup)
const { appDir, nuxtConfig } = await setupDocs(args.dir, { ...opts.setup, dev: true })
process.chdir(appDir)
await import('nuxi').then((nuxi) =>
nuxi.runCommand('dev', [appDir, '--no-fork', '--port', '4000'], { overrides: nuxtConfig }),
Expand Down
3 changes: 2 additions & 1 deletion layers/core/cli/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const pkgDir = fileURLToPath(new URL('../../..', import.meta.url))

export interface SetupDocsOptions {
defaults?: DocsConfig
dev?: boolean
extends?: string[]
}

Expand All @@ -21,7 +22,7 @@ export async function setupDocs(docsDir: string, opts: SetupDocsOptions = {}) {
docsconfig.dir = docsDir = resolve(docsconfig.dir || docsDir)

// URL is required for production build (SEO)
if (!docsconfig.url) {
if (!docsconfig.url && !opts.dev) {
throw new Error('`url` config is required for production build!')
}

Expand Down

0 comments on commit 9eb9b76

Please sign in to comment.