{"id":18925,"library":"wc-bundler","title":"wc-bundler","description":"A bundler for Web Components. Current stable version is 0.10.8, with ongoing active development and irregular release cadence. It provides TypeScript support out of the box and focuses on bundling single-file web components into a distributable format. Compared to larger bundlers like Webpack or Rollup, wc-bundler is lightweight and targeted specifically at Web Component authors.","status":"active","version":"0.10.8","language":"javascript","source_language":"en","source_url":"https://github.com/mofon-design/renderer","tags":["javascript","web-component","bundler","typescript"],"install":[{"cmd":"npm install wc-bundler","lang":"bash","label":"npm"},{"cmd":"yarn add wc-bundler","lang":"bash","label":"yarn"},{"cmd":"pnpm add wc-bundler","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only; require() will not work.","wrong":"const bundle = require('wc-bundler').bundle","symbol":"bundle","correct":"import { bundle } from 'wc-bundler'"},{"note":"Exports the package version string.","symbol":"version","correct":"import { version } from 'wc-bundler'"}],"quickstart":{"code":"import { bundle } from 'wc-bundler';\n\nconst result = await bundle({\n  input: 'src/my-component.ts',\n  output: 'dist/my-component.js',\n  format: 'esm',\n  types: true,\n  minify: true\n}, { key: process.env.KEY ?? '' });\n\nconsole.log('Bundled:', result.outputFiles);","lang":"typescript","description":"Shows how to bundle a TypeScript web component into an ESM module with type declarations."},"warnings":[{"fix":"Use await when calling bundle().","message":"As of version 0.8.0, the API changed from synchronous to asynchronous.","severity":"breaking","affected_versions":">=0.8.0"},{"fix":"Use 'esm' or 'cjs' instead.","message":"The 'format' option 'umd' is deprecated and will be removed in 1.0.","severity":"deprecated","affected_versions":">=0.9.0"},{"fix":"Set { types: true } in options.","message":"TypeScript declarations are only generated when 'types: true' is explicitly set.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use import { bundle } from 'wc-bundler' in an ESM context.","cause":"Using require() instead of import.","error":"Error: bundle is not a function"},{"fix":"Run npm install wc-bundler.","cause":"Package not installed.","error":"Cannot find module 'wc-bundler'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}