Registry / devops / vite-babel-plugin

vite-babel-plugin

JSON →
library0.0.2jsnpmunverified

A Vite plugin that enables Babel transformation during the build process, allowing developers to apply custom Babel plugins and presets. Current version is 0.0.2, but it is marked as deprecated/unmaintained. It only supports Vite 1.x (vite@^1.0.0-rc.9 || ^1.0.0), which is also deprecated. For modern Vite projects (v2+), use official Vite plugins or @rollup/plugin-babel. This plugin is more of a proof-of-concept than a production-ready tool.

npm install vite-babel-plugin
INSTALL
IMPORT
SIG · VITE-BABEL-PLUGIN
V
vite-babel-plugin
devopsjavascriptv0.0.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import viteBabel from 'vite-babel-plugin'
const viteBabel = require('vite-babel-plugin')
ESM-only; CommonJS require is not supported as it's a Vite plugin designed for ESM.
viteBabel (named)
import { viteBabel } from 'vite-babel-plugin'
import viteBabel from 'vite-babel-plugin'
Named export is available but default export is also provided. Named export reduces risk of naming collisions.
types (if any)
import type { ViteBabelOptions } from 'vite-babel-plugin'
No official types declared; use @types or define manually.

Shows how to use vite-babel-plugin in a Vite config with custom Babel plugins and presets.

import { defineConfig } from 'vite'; import viteBabel from 'vite-babel-plugin'; export default defineConfig({ plugins: [ viteBabel({ babelConfig: { plugins: [['@babel/plugin-transform-arrow-functions', { spec: true }]], presets: ['@babel/preset-env'] } }) ] });
Debug
Known issues
deprecatedPackage is deprecated; no updates since 2020. Use @rollup/plugin-babel or official Vite plugins instead.
fix
Migrate to @rollup/plugin-babel with Vite's rollupOptions.
affects: >=0.0.0
breakingOnly works with Vite 1.x; incompatible with Vite 2+.
fix
Upgrade Vite to v2+ and switch to compatible Babel integration.
affects: >=0.0.0
gotchaBabel config should not include @babel/preset-env for library mode, as it may transform ES modules incorrectly.
fix
Use module:false in @babel/preset-env targets or avoid preset-env for library builds.
affects: >=0.0.0
Errors
Common errors & fixes
Cannot find module 'vite-babel-plugin'
Package not installed or installed as devDependency incorrectly.
fix
Run 'npm install vite-babel-plugin --save-dev' and ensure node_modules is present.
TypeError: viteBabel is not a function
Using default import when named export was intended; or vice versa.
fix
Use 'import viteBabel from 'vite-babel-plugin'' for default or 'import { viteBabel } from 'vite-babel-plugin'' for named.
Error: Vite version 2.x is not supported
Incompatible Vite version; plugin requires Vite 1.x.
fix
Downgrade Vite to 1.x or use an alternative Babel plugin for Vite 2+.
Upgrade
Version history
0.0.2latest on npm
Audit
Dependencies
viterequiredpeer dependency; only compatible with Vite 1.x
Agent activity
7 hits · last 30 days
node
6
Resources
vite-babel-plugin — npm install vite-babel-plugin · libregistry