esbuild

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 5, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package esbuild provides a bundler for frontend components using esbuild's Go API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bundler

type Bundler struct {
	// contains filtered or unexported fields
}

Bundler compiles frontend components using esbuild.

func NewBundler

func NewBundler(cfg *Config, outputDir string, devMode bool) *Bundler

NewBundler creates a bundler with the given configuration.

func (*Bundler) Build

func (b *Bundler) Build() error

Build compiles the components bundle. If a build.mjs file exists, it uses Node.js to run it (for plugin support). Otherwise, it uses esbuild's Go API directly.

func (*Bundler) Config

func (b *Bundler) Config() *Config

Config returns the bundler configuration.

type Config

type Config struct {
	// Entry is the path to the entry point file (e.g., "components/index.ts")
	Entry string

	// Include is the list of directories to watch for changes (for HMR).
	// These directories are also available for imports.
	// node_modules is always included automatically.
	Include []string
}

Config configures the esbuild bundler for frontend components.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL