next_build/
build_options.rs

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