Registry / devops / rollup-plugin-oxc

rollup-plugin-oxc

JSON →
library0.7.1jsnpmunverified

A Rollup plugin that combines resolving, transforming, minifying TypeScript, and generating type declarations using the oxc toolchain. Current stable version is 0.7.1, released monthly. It replaces multiple plugins like @rollup/plugin-node-resolve, @rollup/plugin-typescript, and @rollup/plugin-terser with a single unified plugin. Key differentiators include deep integration with oxc for high performance, support for tsconfig-based options, and compatibility with both Rollup and Rolldown. It is ESM-only and requires Rollup 4+.

npm install rollup-plugin-oxc
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-OXC
R
rollup-plugin-oxc
devopsjavascriptv0.7.1
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.

default
import oxc from 'rollup-plugin-oxc'
const oxc = require('rollup-plugin-oxc')
Package is ESM-only; require() will fail. Use import statement.
OxcOptions
import type { OxcOptions } from 'rollup-plugin-oxc'
import { OxcOptions } from 'rollup-plugin-oxc'
OxcOptions is a TypeScript type; use type import for runtime safety.
oxc
import oxc from 'rollup-plugin-oxc'
import { oxc } from 'rollup-plugin-oxc'
Plugins are exported as default, not named. Named export does not exist.

This shows a minimal Rollup configuration using rollup-plugin-oxc to bundle a TypeScript entry point with minification enabled.

import oxc from 'rollup-plugin-oxc'; export default { input: 'src/index.ts', output: { dir: 'dist', format: 'esm', }, plugins: [ oxc({ minify: true, tsconfig: 'tsconfig.json', }), ], };
Debug
Known issues
gotchaPackage is ESM-only; using require() will throw an error.
fix
Use ESM imports: `import oxc from 'rollup-plugin-oxc'`
affects: >=0.1.0
gotchaNamed export 'oxc' does not exist; only default export is available.
fix
Use default import: `import oxc from 'rollup-plugin-oxc'`
affects: >=0.1.0
gotchaTypeScript type 'OxcOptions' is only exported as a type; importing it at runtime will fail.
fix
Use `import type { OxcOptions } from 'rollup-plugin-oxc'`
affects: >=0.1.0
gotchaThe plugin replaces @rollup/plugin-node-resolve, @rollup/plugin-typescript, and @rollup/plugin-terser; do not combine them.
fix
Remove the other plugins and use only oxc().
affects: >=0.1.0
deprecatedThe `resolve` option may be deprecated in future versions in favor of standalone oxc-resolver integration.
fix
Check changelog and migrate to new configuration shape if needed.
affects: >=0.5.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module not supported
Using CommonJS require() to import an ESM-only package.
fix
Change to `import oxc from 'rollup-plugin-oxc'`
SyntaxError: Named export 'oxc' not found. The requested module 'rollup-plugin-oxc' is a CommonJS module, which may not support all module.exports as named exports.
Trying to import a named export 'oxc' when only default export exists.
fix
Use `import oxc from 'rollup-plugin-oxc'`
TypeError: oxc is not a function
If you imported the default incorrectly or passed an invalid argument.
fix
Ensure you pass an object with valid options or omit the argument entirely.
Error: Rollup must be at least version 4.0.0 to use this plugin.
Older version of Rollup is installed.
fix
Update Rollup: `npm install rollup@latest`
Upgrade
Version history
0.7.1latest on npm
Audit
Dependencies
rolluprequiredPeer dependency; plugin only works with Rollup
Agent activity
10 hits · last 30 days
node
10
Resources
rollup-plugin-oxc — npm install rollup-plugin-oxc · libregistry