@obuild/plugin-oxc-transform
v0.0.2
Published
Oxc transform plugin for obuild
Downloads
4
Readme
📦 @obuild/plugin-oxc-transform 😯
Oxc transform plugin for obuild.
The oxc-transform plugin handles TS(X)/JS(X) file transformations using the oxc-transform package under the hood.
Usage
Import the plugin in your build configuration and add it to the plugins array. You can also configure it with options.
import { defineBuildConfig } from "obuild/config";
import { oxcTransform } from "@obuild/plugin-oxc-transform";
export default defineBuildConfig({
entries: [
{
type: "transform",
input: "./src/runtime/",
outDir: "./dist/runtime/",
plugins: [
oxcTransform({
// Configuration options
}),
],
},
],
});Options
The following interface describes the options you can pass to the plugin:
import type { TransformOptions } from "oxc-transform";
import type { Config, Extensions, OutputExtension } from "./config.ts";
import type { InputFile, PluginContext } from "obuild";
export interface OxcTransformPluginOptions {
/** The output file extension for transformed files. */
outputExtension?: OutputExtension;
/** Configuration for processing source files based on their extensions. */
inputExtensions?: Extensions;
/**
* Options passed to oxc-transform.
*
* See [oxc-transform](https://www.npmjs.com/package/oxc-transform) for more
* details.
*/
transform?: Omit<TransformOptions, "lang" | "sourceType"> & {
typescript?: {
declaration?: "Please use `@obuild/plugin-oxc-dts` to generate declarations!";
};
};
/**
* Configuration hook that allows you to modify the configuration for a
* specific file.
*
* @param inputFile - The input file.
* @param config - The current configuration for the plugin.
* @param context - The plugin context.
* @returns Modified configuration or undefined if the file should not be
* processed.
*/
fileConfig?: (
inputFile: InputFile,
config: Config,
context: PluginContext,
) => Config | undefined;
}License
💛 Released under the MIT license.
🤖 auto updated with automd
