Skip to content

unplugin/unplugin-oxc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

6fdaef1 · Mar 11, 2025

History

40 Commits
Feb 10, 2025
Feb 10, 2025
Feb 12, 2025
Mar 9, 2025
Feb 10, 2025
Feb 10, 2025
Feb 10, 2025
Feb 10, 2025
Feb 12, 2025
Feb 10, 2025
Mar 11, 2025
Mar 11, 2025
Feb 12, 2025
Feb 10, 2025
Feb 12, 2025

Repository files navigation

unplugin-oxc npm

Unit Test

Oxc 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 and @rollup/plugin-node-resolve.

Installation

npm i -D unplugin-oxc
Vite
// vite.config.ts
import Oxc from 'unplugin-oxc/vite'

export default defineConfig({
  plugins: [Oxc()],
})


Rollup
// rollup.config.js
import Oxc from 'unplugin-oxc/rollup'

export default {
  plugins: [Oxc()],
}


Rolldown
// rolldown.config.js
import Oxc from 'unplugin-oxc/rolldown'

export default {
  plugins: [Oxc()],
}


esbuild
import { build } from 'esbuild'
import Oxc from 'unplugin-oxc/esbuild'

build({
  plugins: [Oxc()],
})


Webpack
// webpack.config.js
import Oxc from 'unplugin-oxc/webpack'

export default {
  /* ... */
  plugins: [Oxc()],
}


Rspack
// rspack.config.js
import Oxc from 'unplugin-oxc/rspack'

export default {
  /* ... */
  plugins: [Oxc()],
}


unloader
// unloader.config.ts
import Oxc from 'unplugin-oxc/unloader'

export default defineConfig({
  plugins: [Oxc()],
})


Usage

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<TransformOptions, 'sourcemap'> | 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<MinifyOptions, 'sourcemap'> | false
  sourcemap?: boolean
}

Sponsors

License

MIT License © 2025-PRESENT 三咲智子