{"id":27967,"library":"monosize-bundler-vite","title":"monosize-bundler-vite","description":"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.","status":"active","version":"0.3.0","language":"javascript","source_language":"en","source_url":"https://github.com/microsoft/monosize","tags":["javascript","typescript"],"install":[{"cmd":"npm install monosize-bundler-vite","lang":"bash","label":"npm"},{"cmd":"yarn add monosize-bundler-vite","lang":"bash","label":"yarn"},{"cmd":"pnpm add monosize-bundler-vite","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency required to bundle fixtures","package":"vite","optional":false}],"imports":[{"note":"Package uses ESM default export. CommonJS require is not supported.","wrong":"import { viteBundler } from 'monosize-bundler-vite';","symbol":"default (viteBundler)","correct":"import viteBundler from 'monosize-bundler-vite';"},{"note":"Type import for TypeScript; not needed for runtime.","wrong":null,"symbol":"viteBundler (type)","correct":"import type { Bundler } from 'monosize-bundler-vite';"},{"note":"If using CJS, must access .default because package is ESM-only.","wrong":"const viteBundler = require('monosize-bundler-vite');","symbol":"viteBundler (CommonJS)","correct":"const viteBundler = require('monosize-bundler-vite').default;"}],"quickstart":{"code":"// monosize.config.mjs\nimport viteBundler from 'monosize-bundler-vite';\n\nexport default {\n  repository: 'https://github.com/example/example.git',\n  root: '.',\n  output: './monosize-output.json',\n  bundler: viteBundler(config => {\n    config.resolve ??= {};\n    config.resolve.alias = {\n      ...config.resolve.alias,\n      'react': 'react/dist/react.esm.js',\n    };\n    return config;\n  }),\n};","lang":"typescript","description":"Configures monosize to use Vite bundler with a custom alias for React."},"warnings":[{"fix":"Ensure your build time accounts for sequential processing; currently unavoidable.","message":"Sequential builds regardless of --build-mode: Vite cannot emit multiple standalone IIFE bundles in one build; fixtures are built one by one.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Run 'npm install vite --save-dev' or equivalent; version compatibility should be checked.","message":"Peer dependency on 'vite' required and must be installed separately.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Use default import: import viteBundler from 'monosize-bundler-vite';","message":"The package exports a default export only, not a named export. Prior to v0.2.0, named export might have existed?","severity":"breaking","affected_versions":">=0.3.0"},{"fix":"N/A","message":"No deprecated APIs known at this version.","severity":"deprecated","affected_versions":"0.3.0"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Run 'npm install monosize-bundler-vite' and ensure node_modules is present.","cause":"Missing dependency or type package not installed; TypeScript may not resolve types.","error":"Cannot find module 'monosize-bundler-vite' or its corresponding type declarations."},{"fix":"Use 'import viteBundler from ...' (ESM) or 'const viteBundler = require('...').default' (CJS).","cause":"Using named import instead of default import in CJS context without .default.","error":"viteBundler is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}