{"library":"rolldown","title":"Rolldown","description":"Rolldown is a high-performance JavaScript and TypeScript bundler written in Rust, aiming to unify and replace esbuild and Rollup in build pipelines like Vite. It offers 10-30x faster builds than Rollup due to its Rust-based, parallel processing architecture. Currently at version `1.0.0-rc.16`, Rolldown is in a Release Candidate phase, signaling API stability with no planned breaking changes before the 1.0 stable release, though experimental features like minification may still have rough edges. It features a Rollup-compatible plugin API, built-in transforms for TypeScript and JSX powered by Oxc, native CJS/ESM interoperability without additional plugins, and granular code splitting akin to Webpack's `optimization.splitChunks`. Rolldown is designed to serve as Vite 8+'s default bundler but can also be used as a standalone tool, offering more control than esbuild when complex chunking is required.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install rolldown"],"cli":{"name":"rolldown","version":null}},"imports":["import { rolldown } from 'rolldown';","import { defineConfig } from 'rolldown';","import type { RolldownInputOptions, RolldownOutputOptions } from 'rolldown';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { rolldown, defineConfig } from 'rolldown';\nimport path from 'path';\n\nasync function buildMyProject() {\n  const inputDir = path.resolve(__dirname, 'src');\n  const outputDir = path.resolve(__dirname, 'dist');\n\n  const options = defineConfig({\n    input: path.join(inputDir, 'main.ts'),\n    output: {\n      dir: outputDir,\n      format: 'esm',\n      entryFileNames: '[name]-[hash].js',\n      chunkFileNames: 'chunks/[name]-[hash].js',\n      sourcemap: true,\n      minify: process.env.NODE_ENV === 'production' ? 'dce-only' : false, // DCE-only minification is default since v1.0.0-rc.7\n    },\n    plugins: [\n      // Example: A simple plugin to log file IDs during resolution\n      {\n        name: 'log-resolve-id',\n        resolveId(source, importer, options) {\n          console.log(`Resolving: ${source} (imported by ${importer || 'entry'})`);\n          return null; // Let other resolvers handle it\n        }\n      }\n    ],\n    // Rolldown handles TypeScript and Node.js module resolution out of the box\n    // No need for @rollup/plugin-typescript or @rollup/plugin-node-resolve\n    tsconfig: true, // Auto-detect tsconfig.json\n  });\n\n  console.log('Starting Rolldown build...');\n  const bundle = await rolldown(options);\n\n  console.log('Writing bundle to disk...');\n  await bundle.write(options.output);\n  console.log('Build complete!');\n}\n\n// Run the build process\nbuildMyProject().catch(console.error);\n\n// Example of an entry file (src/main.ts)\n// export * from './utils';\n// console.log('Hello from main.ts');\n\n// Example of a utility file (src/utils.ts)\n// export const sum = (a: number, b: number) => a + b;\n","lang":"typescript","description":"This quickstart demonstrates how to programmatically use Rolldown to bundle a TypeScript project, including basic configuration, output options, and a simple custom plugin.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}