rollup-plugin-oxc-transform
v0.1.0
Published
Rollup plugin used to transpile JavaScript/TypeScript code with oxc
Maintainers
Readme
rollup-plugin-oxc-transform
🍣 A Rollup plugin to transpile TypeScript/JavaScript with oxc-transformer.
[!WARNING] Work in progress
[!TIP] If you need to generate declarations consider to use unplugin-isolated-decl
Install
npm i --save-dev rollup oxc-transform oxc-resolve rollup-plugin-oxc-transformyarn add --dev rollup oxc-transform oxc-resolve rollup-plugin-oxc-transformpnpm add --save-dev rollup oxc-transform oxc-resolve rollup-plugin-oxc-transformUsage
// rollup.config.js
import { defineConfig } from 'rollup';
import { oxcTransform } from 'rollup-plugin-oxc-transform';
export default defineConfig({
input: 'src/index.js',
output: {
dir: 'dist',
format: 'esm',
},
plugins: [
oxcTransform(/* options */),
// other plugins...
],
});Options
[!TIP] Typescript declaration files are included in the plugin release, so you can rely on autocomplete features when providing plugin configuration
include
- Type:
FilterPattern - Default:
/\.[mc]?[jt]sx?$/
Which files are processed by the plugin
exclude
- Type:
FilterPattern - Default:
/node_modules/
Which files are excluded from plugin processing
resolveOptions
- Type:
ResolveOptions - Default:
undefined
Options passed to oxc-resolver.
By default the plugin will provide the following options:
conditionNames['node', 'import']extensions['.ts', '.tsx', '.mjs', '.js', '.cjs', '.jsx']
[!NOTE] They can be both customized by passing your own property via
resolveOptions
transformOptions
- Type:
Omit<TransformOptions, 'typescript'>; - Default:
undefined
All options accept by oxc-transform excluding typescript property.
[!WARNING] If you need to generate declarations consider to use unplugin-isolated-decl
Meta
Thanks
This plugin is based on @rollup/plugin-swc
