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
//! JavaScript and TypeScript bundling using esbuild.
//!
//! This module provides functionality to bundle JavaScript and TypeScript files
//! using esbuild as the underlying bundler. It handles npm dependency installation
//! and executes esbuild with minification and bundling enabled.
use Path;
use crate::;
/// Bundles a JavaScript or TypeScript file using esbuild.
///
/// This function installs npm dependencies if needed, then runs esbuild
/// with minification and bundling enabled.
///
/// # Errors
///
/// This function does not return errors directly. Install and bundle failures
/// are surfaced as panics.
///
/// # Panics
///
/// * Panics if the npm install or esbuild command fails to execute.
/// * Panics if the target or output path contains invalid UTF-8 characters.