https://github.com/oxc-project/oxc-webpack-loader
https://github.com/oxc-project/oxc-webpack-loader
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/oxc-project/oxc-webpack-loader
- Owner: oxc-project
- License: mit
- Created: 2026-02-25T02:46:50.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2026-06-14T21:57:21.000Z (about 1 month ago)
- Last Synced: 2026-06-14T23:22:39.197Z (about 1 month ago)
- Language: JavaScript
- Homepage: https://npmx.dev/package/oxc-webpack-loader
- Size: 332 KB
- Stars: 17
- Watchers: 0
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Agents: AGENTS.md
Awesome Lists containing this project
- awesome-rstack - oxc-webpack-loader
README
[![MIT licensed][license-badge]][license-url]
[![Build Status][ci-badge]][ci-url]
[![npm][npm-badge]][npm-url]
[![Discord chat][discord-badge]][discord-url]
[![Website][website-badge]][website-url]
## oxc-loader
Webpack loader for [oxc-transform](https://oxc.rs/docs/guide/usage/transformer.html#features). A drop-in replacement for `swc-loader` and `babel-loader` that uses Oxc for fast JavaScript and TypeScript transformation.
## Install
```bash
npm install -D oxc-webpack-loader oxc-transform
```
## Usage
**webpack.config.js**
```js
module.exports = {
module: {
rules: [
{
test: /\.[jt]sx?$/,
exclude: /node_modules/,
use: {
loader: "oxc-webpack-loader",
options: {
// oxc-transform options
// https://oxc.rs/docs/guide/usage/transformer.html#features
},
},
},
],
},
};
```
### JSX
```js
{
loader: "oxc-webpack-loader",
options: {
jsx: {
runtime: "automatic", // or "classic"
},
},
}
```
### TypeScript
TypeScript is supported out of the box. No additional configuration is needed - just include `.ts` and `.tsx` in the `test` pattern.
### Target
```js
{
loader: "oxc-webpack-loader",
options: {
target: "es2015",
},
}
```
### Source Maps
```js
{
loader: "oxc-webpack-loader",
options: {
sourcemap: true,
},
}
```
Source maps are also automatically enabled when webpack's `devtool` option is set.
### Sync Mode
```js
{
loader: "oxc-webpack-loader",
options: {
sync: true,
},
}
```
## Options
All [oxc-transform `TransformOptions`](https://oxc.rs/docs/guide/usage/transformer.html#features) are supported, plus:
| Option | Type | Default | Description |
| ------ | --------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `sync` | `boolean` | `false` | Use `transformSync` instead of `transform`. The async `transform` spawns a thread per call, which can be slower due to overhead. Sync mode runs on the main thread and may be faster for small files. |
## License
Oxc is free and open-source software licensed under the [MIT License](./LICENSE).
[license-badge]: https://img.shields.io/badge/license-MIT-blue.svg
[license-url]: https://github.com/oxc-project/oxc-webpack-loader/blob/main/LICENSE
[ci-badge]: https://github.com/oxc-project/oxc-webpack-loader/actions/workflows/ci.yml/badge.svg?event=push&branch=main
[ci-url]: https://github.com/oxc-project/oxc-webpack-loader/actions/workflows/ci.yml?query=event%3Apush+branch%3Amain
[npm-badge]: https://img.shields.io/npm/v/oxc-loader
[npm-url]: https://npmx.dev/package/oxc-webpack-loader
[discord-badge]: https://img.shields.io/discord/1079625926024900739?logo=discord&label=Discord
[discord-url]: https://discord.gg/9uXCAwqQZW
[website-badge]: https://img.shields.io/badge/Website-blue
[website-url]: https://oxc.rs