https://github.com/colinaaa/typia-rspack-plugin
A Rspack plugin for typia.
https://github.com/colinaaa/typia-rspack-plugin
Last synced: 8 days ago
JSON representation
A Rspack plugin for typia.
- Host: GitHub
- URL: https://github.com/colinaaa/typia-rspack-plugin
- Owner: colinaaa
- License: mit
- Created: 2025-02-04T09:17:34.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2025-04-01T02:25:45.000Z (15 days ago)
- Last Synced: 2025-04-01T03:28:14.634Z (15 days ago)
- Language: TypeScript
- Size: 108 KB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-rspack - typia-rspack-plugin - TypeScript transformer for runtime type checking and validation. (Plugins / Rspack Plugins)
README
# typia-rspack-plugin
A Rspack plugin for [typia](https://github.com/samchon/typia) - TypeScript transformer for runtime type checking and validation.
## Why
This plugin is a lightweight alternative to using the full `unplugin-typia` package. While `unplugin-typia` supports multiple bundlers (Webpack, Vite, Rollup, etc.), this plugin is specifically designed for Rspack users. By only including the Rspack-specific code, we can significantly reduce the installation size and dependencies.
If you're using Rspack as your bundler and typia for runtime type checking, this plugin provides the same functionality as `unplugin-typia` but with a smaller footprint.
## Usage
Add the plugin to your `rspack.config.js`:
```typescript
import { TypiaRspackPlugin } from "typia-rspack-plugin";export default {
plugins: [
new TypiaRspackPlugin(),
],
};
```### Using with Rslib
If you're using [Rslib](https://github.com/web-infra-dev/rslib), you can add the plugin to your `rslib.config.ts`:
```javascript
import { defineConfig } from "@rslib/core";
import { TypiaRspackPlugin } from "typia-rspack-plugin";export default defineConfig({
lib: [
{ format: "esm" },
],
tools: {
rspack: {
plugins: [
new TypiaRspackPlugin(),
],
},
},
});
```## Options
The plugin accepts all options supported by `@ryoppippi/unplugin-typia`. For detailed options, please refer to the [`unplugin-typia` documentation](https://github.com/ryoppippi/unplugin-typia).
## Development
Build the library:
```bash
pnpm build
```Build the library in watch mode:
```bash
pnpm dev
```## License
MIT License - see the [LICENSE](LICENSE) file for details.