@ata-project/unplugin weekly downloads statistics
By ata-project · npm · Webpack plugins
Build-time JSON Schema for Vite, Webpack, Rollup, Rolldown, esbuild, Rspack and Bun: compileAway takes the runtime compiler out of the bundle, and zod, valibot and TypeBox modules are compiled at build time.
@ata-project/unplugin has 389 recorded weekly downloads on npm, an increase of 6.9% over the past 30 days, ranking #2320 of 3,247 tracked listings.
About @ata-project/unplugin
@ata-project/unplugin
Compiles ata-validator at build time, in Vite, Webpack, Rollup, Rolldown, esbuild, Rspack and Bun. One plugin, built on unplugin.
Each new Validator(schema) in your code whose schema the build can read becomes a compiled validator that gives the same answers, errors and filled defaults, and the compiler stays out of the page. Your code does not change. An order form with six fields, its errors read on submit, goes from 55.3 KB gzipped on the runtime to 4.5 KB, and on a throttled phone profile is ready in 372 ms instead of 779 (ata-validator 1.63.0 and this plugin's 0.12.0; the measurements are in ir and in ata-validator's README). See compileAway.
It also compiles JSON Schema files into self-contained modules with TypeScript declarations. Such a module imports nothing; a small schema compiles to about 1.3 KB gzipped and a ten-field one to about 2.6 KB, full error detail included, on ata-validator 1.36.0. It exports validate, isValid and the inferred type, and runs anywhere plain JavaScript runs. Schemas can be authored as .json, .js or .ts.
A form that validates with react-hook-form's zodResolver(schema) is compiled the same way, without changing the form: where the build can read the schema, zod leaves the page (a Next.js form page went from 43.5 to 15.4 KB gzipped). This is on by default. zodResolver: false turns it off, and npx @ata-project/unplugin scan shows which calls a build would compile, and why not the others, before you add the plugin. See react-hook-form with zod.
Install
npm install --save-dev @ata-project/unplugin ata-validator
ata-validator is a peer dependency. A page's build uses it at build time only, and the page carries none of it. A generated validator file that a server imports without bundling (<module>.validators.mjs, the OpenAPI validators) runs on the runtime there, so that server needs ata-validator in its dependencies.
Setup
Vite:
// vite.config.ts
import ata from '@ata-project/unplugin/vite'
export default {
plugins: [ata({ schemas: 'src/**/*.schema.json' })],
}
Webpack:
// webpack.config.js
const ata = require('@ata-project/unplugin/webpack')
module.exports = {
plugins: [ata({ schemas: 'src/**/*.schema.json' })],
}
Rollup:
// rollup.config.js
import ata from '@ata-project/unplugin/rollup'
export default {
// Rollup has no project root; tell the plugin where the globs start.
plugins: [ata({ schemas: 'src/**/*.schema.json', root: process.cwd() })],
}
esbuild:
import { build } from 'esbuild'
import ata from '@ata-project/unplugin/esbuild'
await build({
entryPoints: ['src/main.ts'],
bundle: true,
plugins: [ata({ schemas: 'src/**/*.schema.json' })],
})
Rspack:
// rspack.config.js
const ata = require('@ata-project/unplugin/rspack')
module.exports = {
plugins: [ata({ schemas: 'src/**/*.schema.json' })],
}
Bun:
// build.ts
import ata from '@ata-project/unplugin/bun'
await Bun.build({
entrypoints: ['./src/index.ts'],
outdir: './dist',
plugins: [ata({ schemas: 'src/**/*.schema.json' })],
})
The same call with compile: { outfile: './app' } writes an executable in
which the compiled validators stand in for the runtime (bun build --compile
on the command line takes no plugins, so the build goes through Bun.build).
Rolldown:
// rolldown.config.js
import ata from '@ata-project/unplugin/rolldown'
export default {
plugins: [ata({ schemas: 'src/**/*.schema.json', root: process.cwd() })],
}
Next.js: withAta wraps the config and covers both bundlers Next runs,
Turbopack (the default since Next.js 16) through a loader and webpack
(next build --webpack) through the plugin. The rest of the config is kept.
// next.config.mjs
import withAta from '@ata-project/unplugin/next'
export default withAta({ /* your config */ }, { /* plugin options */ })
On a Next.js 16 page with one order form that reads its errors, the
validator adds 4.2 KB gzipped to the first load under Turbopack and 4.6 KB
under webpack, against 67.5 and 58.3 KB for the runtime Validator. Under
Turbopack by hand, the loader is @ata-project/unplugin/turbopack in
turbopack.rules.
Keep your schema library, lose it from the page
A client that writes its schemas in zod, valibot or TypeBox can keep them and still ship a page with neither the library nor a validator runtime. The zod option names modules that export zod 4 schemas, and from names modules of any of the three, each export by its own library; the build loads each module (TypeScript through jiti), converts every exported schema (zod's own z.toJSONSchema, valibot's @valibot/to-json-schema, a TypeBox schema as written), and writes <module>.validators.mjs and .d.mts beside it, one { validate, isValidObject } per export, which the page's build compiles away like any other validator.
ata({ zod: 'src/events/*.ts' })
// src/events/widget.ts, unchanged
export const widgetEvent = z.object({ event: z.enum(['view', 'click']), widgetId: z.string().min(1), position: z.number().int().min(0) })
// the page
import { widgetEvent, type WidgetEventInput } from './events/widget.validators.mjs'
const r = widgetEvent.validate(event)
if (!r.valid) log(r.errors.map((e) => ({ path: e.instancePath, message: e.message })))
```…
Description from the npm listing.
- unplugin
- vite-plugin
- webpack-plugin
- rollup-plugin
- esbuild-plugin
- rspack-plugin
- json-schema
- ata-validator
- typescript
- codegen
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (170)Similar npm Webpack plugins plugins
All 20 @ata-project/unplugin alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/@ata-project/unplugin. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.