next_build/
build_options.rs

1use std::path::PathBuf;
2
3use next_core::next_config::Rewrites;
4use turbo_rcstr::RcStr;
5use turbopack_core::issue::IssueSeverity;
6
7#[derive(Clone, Debug)]
8pub struct BuildOptions {
9    /// The root directory of the workspace.
10    pub root: Option<PathBuf>,
11
12    /// The project's directory.
13    pub dir: Option<PathBuf>,
14
15    /// next.config.js's distDir.
16    pub dist_dir: Option<String>,
17
18    /// The maximum memory to use for the build.
19    pub memory_limit: Option<usize>,
20
21    /// The log level to use for the build.
22    pub log_level: Option<IssueSeverity>,
23
24    /// Whether to show all logs.
25    pub show_all: bool,
26
27    /// Whether to show detailed logs.
28    pub log_detail: bool,
29
30    /// Whether to compute full stats.
31    pub full_stats: bool,
32
33    /// The Next.js build context.
34    pub build_context: Option<BuildContext>,
35
36    pub define_env: DefineEnv,
37}
38
39#[derive(Clone, Debug)]
40pub struct BuildContext {
41    /// The build id.
42    pub build_id: String,
43
44    /// Next.js config rewrites.
45    pub rewrites: Rewrites,
46}
47
48#[derive(Debug, Clone)]
49pub struct DefineEnv {
50    pub client: Vec<(RcStr, Option<RcStr>)>,
51    pub edge: Vec<(RcStr, Option<RcStr>)>,
52    pub nodejs: Vec<(RcStr, Option<RcStr>)>,
53}