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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
//! Unified build API for the Fob bundler.
//!
//! This module provides a configuration-based API for all bundling operations
//! using three orthogonal primitives:
//!
//! 1. **EntryMode**: Shared (entries can share chunks) vs Isolated (independent bundles)
//! 2. **CodeSplittingConfig**: Code splitting configuration (Option = on/off)
//! 3. **ExternalConfig**: External dependencies (None, List, FromManifest)
//!
//! # Examples
//!
//! ```no_run
//! use fob_bundler::BuildOptions;
//!
//! # async fn example() -> fob_bundler::Result<()> {
//! // Single entry standalone bundle
//! let result = BuildOptions::new("./src/index.js")
//! .outfile("dist/bundle.js")
//! .build()
//! .await?;
//!
//! // Library: externalize dependencies
//! let result = BuildOptions::new("./src/index.ts")
//! .externalize_from("package.json")
//! .platform(fob_bundler::Platform::Node)
//! .outfile("dist/index.js")
//! .build()
//! .await?;
//!
//! // App with code splitting
//! let result = BuildOptions::new_multiple(["./src/main.js", "./src/admin.js"])
//! .bundle_together()
//! .with_code_splitting()
//! .outdir("dist")
//! .build()
//! .await?;
//!
//! // Component library: separate independent bundles
//! let result = BuildOptions::new_multiple(["./src/Button.tsx", "./src/Card.tsx"])
//! .bundle_separately()
//! .outdir("dist")
//! .build()
//! .await?;
//! # Ok(())
//! # }
//! ```
use crateResult;
pub use DtsOptions;
pub use EntryPoints;
pub use MinifyLevel;
pub use BuildOptions;
pub use ;
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")
/// .externalize(["react", "react-dom"])
/// .build()
/// .await?;
///
/// // Or construct directly
/// let result = build(BuildOptions {
/// entry: fob_bundler::EntryPoints::Single("./src/index.js".into()),
/// ..Default::default()
/// }).await?;
/// # Ok(())
/// # }
/// ```
pub async