{"id":24927,"library":"astro-redone-rust","title":"Redone (astro-redone-rust)","description":"Redone is a high-performance Rust-based build system for Astro that replaces esbuild and Vite integration with native Rust components (SWC compilation, parallel bundler, tokio-based dev server with HMR). Current stable version is 1.0.0, with an active alpha track for Astro 7.0. Key differentiators: incremental bundling, sub-millisecond invalidation, 50%+ faster compilation than esbuild, 40%+ faster bundling than Rollup, and memory-efficient caching. Ships TypeScript types and uses napi-rs for Node.js bindings. Actively developed with frequent releases.","status":"active","version":"1.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/withastro/astro","tags":["javascript","astro","rust","build","compiler","bundler","esbuild","vite","performance","typescript"],"install":[{"cmd":"npm install astro-redone-rust","lang":"bash","label":"npm"},{"cmd":"yarn add astro-redone-rust","lang":"bash","label":"yarn"},{"cmd":"pnpm add astro-redone-rust","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required to compile Rust native bindings for Node.js","package":"@napi-rs/cli","optional":true},{"reason":"Build system is designed to be used as a replacement for Astro's built-in bundler; typically used with Astro projects","package":"astro","optional":true}],"imports":[{"note":"Redone is ESM-only starting from v1.0.0. CommonJS require will fail with ERR_REQUIRE_ESM.","wrong":"const createBuilder = require('redone')","symbol":"createBuilder","correct":"import { createBuilder } from 'redone'"},{"note":"Type import is available when using TypeScript. For JavaScript, the type is inferred from createBuilder return.","wrong":"","symbol":"Builder","correct":"import type { Builder } from 'redone'"},{"note":"BuildOptions is a type-only export. Using a value import will cause a runtime error in JavaScript.","wrong":"import { BuildOptions } from 'redone'","symbol":"BuildOptions","correct":"import type { BuildOptions } from 'redone'"}],"quickstart":{"code":"import { createBuilder } from 'redone';\n\nasync function build() {\n  const builder = await createBuilder({\n    root: process.cwd(),\n    format: 'esm',\n    target: 'ES2020',\n  });\n\n  // Compile a single file\n  const result = await builder.compileFile(\n    'src/component.ts',\n    `const x: number = 1;\\nexport default x;`,\n    { format: 'esm', sourceMap: true }\n  );\n  console.log(result.code);\n\n  // Bundle the project\n  const bundle = await builder.bundle({\n    entryPoints: ['src/index.ts'],\n    external: ['astro'],\n    format: 'esm',\n  });\n  console.log(bundle.outputFiles);\n\n  await builder.cleanup();\n}\n\nbuild().catch(console.error);","lang":"typescript","description":"Shows how to create a builder, compile a single TypeScript file, bundle a project, and clean up resources."},"warnings":[{"fix":"Upgrade Node.js to version 18 or later.","message":"Redone 1.0.0 drops support for Node.js <18. Requires Node.js 18+.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Update code to use async createBuilder and call methods on the returned Builder instance.","message":"The API changed from v0.x to v1.0.0: createBuilder is now async and returns a Builder object instead of direct compile/bundle functions.","severity":"breaking","affected_versions":">=1.0.0 <1.0.0"},{"fix":"Add format: 'esm' or 'cjs' to createBuilder options.","message":"The 'format' option default is deprecated; you must specify it explicitly in v1.1.0+.","severity":"deprecated","affected_versions":">=1.1.0"},{"fix":"Set moduleResolution to 'bundler' or 'node16' in tsconfig.json.","message":"If using TypeScript, ensure your tsconfig.json includes 'moduleResolution': 'bundler' or 'node16' to resolve the types correctly.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Change const redone = require('redone') to import ... from 'redone' and ensure your package.json has \"type\": \"module\".","cause":"Redone is ESM-only and cannot be required with CommonJS.","error":"Error: Cannot find module 'redone'"},{"fix":"Use import { createBuilder } from 'redone' instead of import redone from 'redone'.","cause":"Incorrect import: using default import instead of named import.","error":"TypeError: redone.createBuilder is not a function"},{"fix":"Install Rust from https://rustup.rs, then run 'pnpm -C packages/redone build:rust'.","cause":"Rust toolchain not installed when building from source.","error":"Error: spawn rustup ENOENT"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}