Registry / web-framework / vite-enhancer-config

vite-enhancer-config

JSON →
library1.3.6jsnpmunverified

A zero-config plugin that enhances Vite configuration for React applications with production-grade optimizations. Current stable version 1.3.6. Integrates SWC for fast compilation (5-10x faster), automatic Fast Refresh (HMR), and built-in bundle analysis. Ships TypeScript types. Requires Vite v4, v5, or v6 and Node >=18. Differentiator: opinionated, minimal setup with automatic production defaults for React projects.

npm install vite-enhancer-config
INSTALL
IMPORT
SIG · VITE-ENHANCER-CONF
V
vite-enhancer-config
web-frameworkjavascriptv1.3.6
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 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

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

viteEnhancerConfig
import { viteEnhancerConfig } from 'vite-enhancer-config'
const viteEnhancerConfig = require('vite-enhancer-config')
ESM-only export; CommonJS require will fail.
default
import viteEnhancerConfig from 'vite-enhancer-config'
import { default as config } from 'vite-enhancer-config'
Default import is supported since v1.0. Named export is also available.
ViteEnhancerOptions
import type { ViteEnhancerOptions } from 'vite-enhancer-config'
import { ViteEnhancerOptions } from 'vite-enhancer-config'
Use `import type` for type-only imports to avoid runtime errors.

Adds SWC compilation and bundle analysis to an existing Vite React setup with typed options.

import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; import { viteEnhancerConfig } from 'vite-enhancer-config'; export default defineConfig({ plugins: [ react(), viteEnhancerConfig({ swc: true, analyzer: true, apiKey: process.env.ANALYZER_KEY ?? '' }) ] });
Debug
Known issues
gotchaUsing CommonJS require will fail because the package is ESM-only.
fix
Use dynamic import or switch to ESM.
affects: >=1.0.0
deprecatedOption `analyzerKey` was renamed to `apiKey` in v1.3.0.
fix
Replace `analyzerKey` with `apiKey` in configuration.
affects: >=1.3.0
gotchaSWC plugin may conflict with Babel-based React plugins (e.g., @vitejs/plugin-react-swc is not needed).
fix
Remove any manual SWC plugin from plugins array when swc option is enabled.
affects: >=1.0.0
breakingNode 18 minimum required; older versions will throw a syntax error.
fix
Upgrade Node.js to v18 or later.
affects: >=1.0.0
gotchaBundle analyzer opens a browser on build; may block CI if not configured.
fix
Set `analyzer` mode to `static` or disable in non-interactive environments.
affects: >=1.0.0
Errors
Common errors & fixes
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'vite-enhancer-config' imported from ...
Package not installed or not in node_modules.
fix
Run `npm install vite-enhancer-config -D`.
TypeError: viteEnhancerConfig is not a function
Wrong import style (CommonJS require on ESM-only package).
fix
Use `import { viteEnhancerConfig } from 'vite-enhancer-config'`.
Error: Cannot use import statement outside a module
Project not configured as ESM (no 'type':'module' in package.json).
fix
Add `"type":"module"` to package.json or rename file to .mjs.
Upgrade
Version history
1.3.6latest on npm
Audit
Dependencies
viterequiredpeer dependency for Vite plugin
reactoptionalworks with React projects
Agent activity
2 hits · last 30 days
node
2
Resources
vite-enhancer-config — npm install vite-enhancer-config · libregistry