forked from vercel/next.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.ts
More file actions
14 lines (13 loc) · 710 Bytes
/
utils.ts
File metadata and controls
14 lines (13 loc) · 710 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import type { NextConfigComplete } from '../server/config-shared'
export function hasCustomExportOutput(config: NextConfigComplete) {
// In the past, a user had to run "next build" to generate
// ".next" (or whatever the distDir) followed by "next export"
// to generate "out" (or whatever the outDir). However, when
// "output: export" is configured, "next build" does both steps.
// So the user-configured distDir is actually the outDir.
// We'll do some custom logic when meeting this condition.
// e.g.
// Will set config.distDir to .next to make sure the manifests
// are still reading from temporary .next directory.
return config.output === 'export' && config.distDir !== '.next'
}