File size: 1,215 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
use std::path::PathBuf;

use next_core::next_config::Rewrites;
use turbo_rcstr::RcStr;
use turbopack_core::issue::IssueSeverity;

#[derive(Clone, Debug)]
pub struct BuildOptions {
    /// The root directory of the workspace.
    pub root: Option<PathBuf>,

    /// The project's directory.
    pub dir: Option<PathBuf>,

    /// next.config.js's distDir.
    pub dist_dir: Option<String>,

    /// The maximum memory to use for the build.
    pub memory_limit: Option<usize>,

    /// The log level to use for the build.
    pub log_level: Option<IssueSeverity>,

    /// Whether to show all logs.
    pub show_all: bool,

    /// Whether to show detailed logs.
    pub log_detail: bool,

    /// Whether to compute full stats.
    pub full_stats: bool,

    /// The Next.js build context.
    pub build_context: Option<BuildContext>,

    pub define_env: DefineEnv,
}

#[derive(Clone, Debug)]
pub struct BuildContext {
    /// The build id.
    pub build_id: String,

    /// Next.js config rewrites.
    pub rewrites: Rewrites,
}

#[derive(Debug, Clone)]
pub struct DefineEnv {
    pub client: Vec<(RcStr, Option<RcStr>)>,
    pub edge: Vec<(RcStr, Option<RcStr>)>,
    pub nodejs: Vec<(RcStr, Option<RcStr>)>,
}