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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
//! Unified build API for the Fob bundler.
//!
//! This module provides a single, flexible configuration-based API for all bundling operations.
//!
//! # Examples
//!
//! ```no_run
//! use fob_bundler::BuildOptions;
//!
//! # async fn example() -> fob_bundler::Result<()> {
//! // Bundle a single file with all dependencies (app/component)
//! let result = BuildOptions::new("./src/index.js")
//! .bundle(true)
//! .build()
//! .await?;
//!
//! // Library: externalize dependencies
//! let result = BuildOptions::new("./src/index.ts")
//! .bundle(false)
//! .platform(fob_bundler::Platform::Node)
//! .external(["react", "react-dom"])
//! .build()
//! .await?;
//!
//! // App with code splitting
//! let result = BuildOptions::new_multiple(["./src/main.js", "./src/admin.js"])
//! .bundle(true)
//! .splitting(true)
//! .outdir("dist")
//! .build()
//! .await?;
//! # Ok(())
//! # }
//! ```
use crateResult;
pub use DtsOptions;
pub use EntryPoints;
pub use BuildOptions;
pub use ;
/// Execute a build with the given options.
///
/// This is the main entry point for all bundling operations in Fob.
/// Use `BuildOptions` builder methods for ergonomic configuration.
///
/// # Examples
///
/// ```no_run
/// use fob_bundler::{build, BuildOptions};
///
/// # async fn example() -> fob_bundler::Result<()> {
/// // Using builder pattern
/// let result = BuildOptions::new("./src/index.js")
/// .bundle(false)
/// .external(["react", "react-dom"])
/// .build()
/// .await?;
///
/// // Or construct directly
/// let result = build(BuildOptions {
/// entry: fob_bundler::EntryPoints::Single("./src/index.js".into()),
/// bundle: false,
/// ..Default::default()
/// }).await?;
/// # Ok(())
/// # }
/// ```
pub async