https://github.com/unplugin/unplugin-oxc
Oxc integration for unplugin.
https://github.com/unplugin/unplugin-oxc
Last synced: 2 months ago
JSON representation
Oxc integration for unplugin.
- Host: GitHub
- URL: https://github.com/unplugin/unplugin-oxc
- Owner: unplugin
- License: mit
- Created: 2025-02-10T04:02:15.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-10-03T06:00:01.000Z (2 months ago)
- Last Synced: 2025-10-03T07:24:13.595Z (2 months ago)
- Language: TypeScript
- Size: 646 KB
- Stars: 33
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# unplugin-oxc
[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![Unit Test][unit-test-src]][unit-test-href]
[Oxc](https://oxc.rs/) integration for unplugin.
## Features
- 🚀 **Blazing Fast**: Transform, resolve, and minify files with Oxc, built in Rust.
- 🦾 **Powerful**: Supports TypeScript and React JSX transformation, identifier replacement, syntax lowering, and more.
- 📦 **Zero Config**: No configuration needed for TypeScript support.
- 🎨 **Customizable**: Fine-tune transform, resolve, and minify options.
- 😈 **Drop-in Replacement**: Easily replace [rollup-plugin-esbuild](https://github.com/egoist/rollup-plugin-esbuild) and [@rollup/plugin-node-resolve](https://github.com/rollup/plugins/tree/master/packages/node-resolve).
## Installation
```bash
npm i -D unplugin-oxc
```
Vite
```ts
// vite.config.ts
import Oxc from 'unplugin-oxc/vite'
export default defineConfig({
plugins: [Oxc()],
})
```
Rollup
```ts
// rollup.config.js
import Oxc from 'unplugin-oxc/rollup'
export default {
plugins: [Oxc()],
}
```
Rolldown
```ts
// rolldown.config.js
import Oxc from 'unplugin-oxc/rolldown'
export default {
plugins: [Oxc()],
}
```
esbuild
```ts
import { build } from 'esbuild'
import Oxc from 'unplugin-oxc/esbuild'
build({
plugins: [Oxc()],
})
```
Webpack
```js
// webpack.config.js
import Oxc from 'unplugin-oxc/webpack'
export default {
/* ... */
plugins: [Oxc()],
}
```
Rspack
```ts
// rspack.config.js
import Oxc from 'unplugin-oxc/rspack'
export default {
/* ... */
plugins: [Oxc()],
}
```
unloader
```ts
// unloader.config.ts
import Oxc from 'unplugin-oxc/unloader'
export default defineConfig({
plugins: [Oxc()],
})
```
## Usage
```ts
interface Options {
/**
* @default [/\.[cm]?[jt]sx?$/],
*/
include?: FilterPattern
/**
* @default [/node_modules/],
*/
exclude?: FilterPattern
enforce?: 'pre' | 'post' | undefined
/**
* Transform options passed to `oxc-transform`
*/
transform?: Omit | false
/**
* Resolve options passed to `oxc-resolver`
*/
resolve?: NapiResolveOptions | false
/**
* The plugin will skip resolving node_modules by default.
* Set this to `true` to resolve node_modules.
* @default false
*/
resolveNodeModules?: boolean
/**
* Minify options passed to `oxc-minify`
*/
minify?: Omit | false
sourcemap?: boolean
}
```
## Sponsors
## License
[MIT](./LICENSE) License © 2025-PRESENT [Kevin Deng](https://github.com/sxzz)
[npm-version-src]: https://img.shields.io/npm/v/unplugin-oxc.svg
[npm-version-href]: https://npmjs.com/package/unplugin-oxc
[npm-downloads-src]: https://img.shields.io/npm/dm/unplugin-oxc
[npm-downloads-href]: https://www.npmcharts.com/compare/unplugin-oxc?interval=30
[unit-test-src]: https://github.com/unplugin/unplugin-oxc/actions/workflows/unit-test.yml/badge.svg
[unit-test-href]: https://github.com/unplugin/unplugin-oxc/actions/workflows/unit-test.yml