Go Bundler

raw JSON →
0.1.5 verified Thu Apr 23 auth: no javascript

Go Bundler is a JavaScript bundler engineered in Golang, designed for rapid asset compilation with minimal configuration. Currently at version 0.1.5, it remains in early development and is explicitly marked as not tested, to be used at one's own risk. Its core features include a built-in development server, automatic rebuilding upon file changes, and support for bundling HTML templates alongside JavaScript files. A key differentiator is its Go-based architecture, contributing to its stated fast performance. Non-JavaScript assets are automatically copied to the bundle directory and referenced as URLs. Due to its nascent stage, a predictable release cadence is not yet established, and it prioritizes ease of use and speed over extensive feature sets or stability guarantees.

error command not found: go-bundler
cause The `go-bundler` executable is not directly in your system's PATH, or you are attempting to run it outside of an npm script context without `npx`.
fix
Use npx go-bundler to execute it, or define a script in your package.json (e.g., "build": "go-bundler") and run npm run build.
error No config file found. Generating...
cause You are running `go-bundler` for the first time, or the `go-bundler-config.json` file is missing from your project root.
fix
This is expected behavior for initial setup. Follow the interactive prompts to generate the configuration file. Once generated, commit go-bundler-config.json to your repository.
gotcha The package is explicitly labeled as 'STILL IN EARLY DEV AND NOT TESTED, USE AT YOUR OWN RISK' in its README. Stability and API guarantees are not provided, and breaking changes may occur frequently without major version bumps.
fix Exercise caution when using in production environments. Pin exact versions (`npm install go-bundler@0.1.5`) and thoroughly test after any updates.
gotcha Unlike many JavaScript bundlers, `go-bundler` is written in Go. This means its internal architecture and potential extension mechanisms (if any are introduced) will differ significantly from Node.js-based tools. It also affects how it's invoked programmatically.
fix Do not expect a typical JavaScript API. Interact with it primarily via its command-line interface. For programmatic control, use `child_process` to execute the CLI.
gotcha Initial setup requires an interactive session to generate the `go-bundler-config.json` file. This means it cannot be fully automated on a fresh install without simulating user input or manually creating the config.
fix Run `npx go-bundler` once manually or in a CI script capable of interactive input to generate the initial configuration file. Commit `go-bundler-config.json` to version control for subsequent non-interactive builds.
npm install go-bundler
yarn add go-bundler
pnpm add go-bundler

Demonstrates how to install go-bundler and initiate its interactive configuration process, followed by typical usage in npm scripts.

npm install --save-dev go-bundler
# After installation, run go-bundler to generate initial config:
npx go-bundler
# This will prompt you to answer questions and create `go-bundler-config.json`.
# Once configured, you can run it via an npm script, e.g., in package.json:
/*
"scripts": {
  "build": "go-bundler build",
  "dev": "go-bundler dev"
}
*/
# Then run: npm run dev