Registry / devops / monosize-bundler-vite

monosize-bundler-vite

JSON →
library0.3.0jsnpmunverified

A Vite bundler adapter for monosize that enables building size measurement fixtures using Vite instead of esbuild. Version 0.3.0 supports customizing Vite's InlineConfig via a callback, allowing resolution aliases and other Vite-specific configuration. Unlike the default esbuild bundler, Vite provides broader compatibility with modern web tooling (e.g., Vue, Svelte plugins). This package is in early development (pre-1.0) and currently has a notable limitation: Vite cannot emit multiple self-contained IIFE bundles in a single build, so fixtures are built sequentially regardless of build mode. Ships TypeScript types.

npm install monosize-bundler-vite
INSTALL
IMPORT
SIG · MONOSIZE-BUNDLER-V
M
monosize-bundler-vite
devopsjavascriptv0.3.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

default (viteBundler)
import viteBundler from 'monosize-bundler-vite';
import { viteBundler } from 'monosize-bundler-vite';
Package uses ESM default export. CommonJS require is not supported.
viteBundler (type)
import type { Bundler } from 'monosize-bundler-vite';
Type import for TypeScript; not needed for runtime.
viteBundler (CommonJS)
const viteBundler = require('monosize-bundler-vite').default;
const viteBundler = require('monosize-bundler-vite');
If using CJS, must access .default because package is ESM-only.

Configures monosize to use Vite bundler with a custom alias for React.

// monosize.config.mjs import viteBundler from 'monosize-bundler-vite'; export default { repository: 'https://github.com/example/example.git', root: '.', output: './monosize-output.json', bundler: viteBundler(config => { config.resolve ??= {}; config.resolve.alias = { ...config.resolve.alias, 'react': 'react/dist/react.esm.js', }; return config; }), };
Debug
Known issues
gotchaSequential builds regardless of --build-mode: Vite cannot emit multiple standalone IIFE bundles in one build; fixtures are built one by one.
fix
Ensure your build time accounts for sequential processing; currently unavoidable.
affects: >=0.1.0
gotchaPeer dependency on 'vite' required and must be installed separately.
fix
Run 'npm install vite --save-dev' or equivalent; version compatibility should be checked.
affects: >=0.1.0
breakingThe package exports a default export only, not a named export. Prior to v0.2.0, named export might have existed?
fix
Use default import: import viteBundler from 'monosize-bundler-vite';
affects: >=0.3.0
deprecatedNo deprecated APIs known at this version.
fix
N/A
affects: 0.3.0
Errors
Common errors & fixes
Cannot find module 'monosize-bundler-vite' or its corresponding type declarations.
Missing dependency or type package not installed; TypeScript may not resolve types.
fix
Run 'npm install monosize-bundler-vite' and ensure node_modules is present.
viteBundler is not a function
Using named import instead of default import in CJS context without .default.
fix
Use 'import viteBundler from ...' (ESM) or 'const viteBundler = require('...').default' (CJS).
Upgrade
Version history
0.3.0latest on npm
Audit
Dependencies
viterequiredpeer dependency required to bundle fixtures
Agent activity
3 hits · last 30 days
node
2
Amazon
1
Resources
monosize-bundler-vite — npm install monosize-bundler-vite · libregistry