Automatic sourcemap generation for debugging
bun build for precompilation.website·Indexed Apr 12, 2026
https://bun.sh/docs/Official documentation for Bun, a fast JavaScript runtime and toolchain serving as a drop-in replacement for Node.js. Covers the Bun Package Manager (bun install), native bundler (bun build), and built-in test runner. Includes guides on installation, TypeScript configuration, runtime features like watch mode and debugging, HTTP server setup with TLS and WebSockets, and file system routing. Supports JavaScriptCore engine execution, plugin APIs, and integration with frameworks like Astro and React.
bun build for precompilation.error.stack identically to Node.js's V8 engine. This ensures compatibility with npm libraries that expect V8 stack trace formatting. The V8 Stack Trace API is implemented for customizing stack trace output.bun setup fails with 'span' file not found, install GCC 11: sudo apt update && sudo apt install gcc-11 g++-11. If the package isn't found, add the repository: sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test first. Then set as default: sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100 and sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 100.bun build --target=bun --production --outdir=dist ./src/index.ts before deployment. Bun bundles HTML imports into a manifest object Bun.serve() uses directly. (2) Runtime Bundling — set development: false to enable in-memory caching of lazily-bundled assets, Cache-Control/ETag headers, and minification.bunx sv create my-app to create a new SvelteKit project. The CLI prompts you to select a template, choose TypeScript support, and select Bun as the package manager. Dependencies are installed automatically during setup.setcap CAP_NET_BIND_SERVICE=+eip ~/.bun/bin/bun. This permanently grants the capability to the bun binary. Skip this step if running as root.neon from @neondatabase/serverless and call it with process.env.DATABASE_URL to create a SQL client. Execute queries using tagged template literals. The client uses SQL-over-HTTP by default. Run with bun ./index.ts.import { neon } from "@neondatabase/serverless";
const sql = neon(process.env.DATABASE_URL);
const rows = await sqlSELECT version();
console.log(rows[0].version);
/docs need conversion to absolute URLs. Use new URL(href, baseUrl).href to resolve relative paths against the page's origin. Wrap in try/catch to handle invalid URLs gracefully. The URL constructor automatically handles protocols, domains, and path resolution.const absoluteURL = new URL(href, url).href; // "/docs" + "https://example.com" → "https://example.com/docs"