A Vite plugin that replaces esbuild transpilation with Babel for files matching include/exclude patterns. Version 0.4.1 is the latest stable release; the plugin is actively maintained with infrequent updates. It enables experimental JavaScript features (e.g., decorators, class properties) that esbuild does not support, providing fine-grained control via Babel configurations. Unlike alternative plugins like @mdx-js/rollup or manual esbuild configure, this plugin integrates seamlessly with Vite's build pipeline and supports both development and production builds. Requires @babel/core as a peer dependency and Vite >=2.0.0.
npm install vite-plugin-babel-compilerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Configures Vite to use Babel compiler with decorator and class property plugins.
Use vite-plugin-babel-compiler@latest or check compatibility; consider using @vitejs/plugin-babel if available.
Wrap all Babel options under `babel` key. See README.
Ensure `include` and `exclude` are arrays. e.g., `include: ['src/**/*.tsx']`
Use conditionals: `plugins: [process.env.NODE_ENV === 'development' ? babel({...}) : null]`npm install -D @babel/core
import babel from 'vite-plugin-babel-compiler' (default) or import { babel } from '...'npm install -D vite-plugin-babel-compiler
Check that the file path matches `include` patterns and is not in `exclude`.