Registry / web-framework / astro-redone-rust

astro-redone-rust

JSON →
library1.0.0jsnpmunverified

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.

npm install astro-redone-rust
INSTALL
IMPORT
SIG · ASTRO-REDONE-RUST
A
astro-redone-rust
web-frameworkjavascriptv1.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

createBuilder
import { createBuilder } from 'redone'
const createBuilder = require('redone')
Redone is ESM-only starting from v1.0.0. CommonJS require will fail with ERR_REQUIRE_ESM.
Builder
import type { Builder } from 'redone'
Type import is available when using TypeScript. For JavaScript, the type is inferred from createBuilder return.
BuildOptions
import type { BuildOptions } from 'redone'
import { BuildOptions } from 'redone'
BuildOptions is a type-only export. Using a value import will cause a runtime error in JavaScript.

Shows how to create a builder, compile a single TypeScript file, bundle a project, and clean up resources.

import { createBuilder } from 'redone'; async function build() { const builder = await createBuilder({ root: process.cwd(), format: 'esm', target: 'ES2020', }); // Compile a single file const result = await builder.compileFile( 'src/component.ts', `const x: number = 1;\nexport default x;`, { format: 'esm', sourceMap: true } ); console.log(result.code); // Bundle the project const bundle = await builder.bundle({ entryPoints: ['src/index.ts'], external: ['astro'], format: 'esm', }); console.log(bundle.outputFiles); await builder.cleanup(); } build().catch(console.error);
astro --version
Debug
Known issues
breakingRedone 1.0.0 drops support for Node.js <18. Requires Node.js 18+.
fix
Upgrade Node.js to version 18 or later.
affects: >=1.0.0
breakingThe API changed from v0.x to v1.0.0: createBuilder is now async and returns a Builder object instead of direct compile/bundle functions.
fix
Update code to use async createBuilder and call methods on the returned Builder instance.
affects: >=1.0.0 <1.0.0
deprecatedThe 'format' option default is deprecated; you must specify it explicitly in v1.1.0+.
fix
Add format: 'esm' or 'cjs' to createBuilder options.
affects: >=1.1.0
gotchaIf using TypeScript, ensure your tsconfig.json includes 'moduleResolution': 'bundler' or 'node16' to resolve the types correctly.
fix
Set moduleResolution to 'bundler' or 'node16' in tsconfig.json.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'redone'
Redone is ESM-only and cannot be required with CommonJS.
fix
Change const redone = require('redone') to import ... from 'redone' and ensure your package.json has "type": "module".
TypeError: redone.createBuilder is not a function
Incorrect import: using default import instead of named import.
fix
Use import { createBuilder } from 'redone' instead of import redone from 'redone'.
Error: spawn rustup ENOENT
Rust toolchain not installed when building from source.
fix
Install Rust from https://rustup.rs, then run 'pnpm -C packages/redone build:rust'.
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies
@napi-rs/clioptionalRequired to compile Rust native bindings for Node.js
astrooptionalBuild system is designed to be used as a replacement for Astro's built-in bundler; typically used with Astro projects
Agent activity
17 hits · last 30 days
node
14
Amazon
1
OpenAI (training)
1
Resources
astro-redone-rust — npm install astro-redone-rust · libregistry