{"id":21894,"library":"rollup-config-webcomponent","title":"rollup-config-webcomponent","description":"Rollup configuration preset for building web components with lit-element. Version 0.3.4 provides an environment-driven config that supports TypeScript, SCSS/Sass, PostCSS, Terser minification, and Babel transpilation. It uses peer dependencies rollup 2.x and tslib 2.0.x. Key differentiators: single import for all plugins and configs, environment flags for bundle/compress/ECMAScript target, and built-in lit-element integration. Suitable for monorepos with multiple packages. Note: not extensively tested in IE11, and uses deprecated 'isAsset' check (no impact).","status":"active","version":"0.3.4","language":"javascript","source_language":"en","source_url":"https://github.com/odinr/rollup/tree/master/packages/config-webcomponent","tags":["javascript","rollup-config","webcomponent","lit-html","scss","sass","template","postcss","minify"],"install":[{"cmd":"npm install rollup-config-webcomponent","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-config-webcomponent","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-config-webcomponent","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency: rollup 2.x required","package":"rollup","optional":false},{"reason":"peer dependency: required for TypeScript compilation","package":"tslib","optional":false}],"imports":[{"note":"Package is ESM-only; CommonJS require will fail.","wrong":"const createConfig = require('rollup-config-webcomponent')","symbol":"default","correct":"import createConfig from 'rollup-config-webcomponent'"},{"note":"Both named and default exports are the same function. Using default import is preferred.","wrong":"import createConfig from 'rollup-config-webcomponent'","symbol":"createConfig","correct":"import { createConfig } from 'rollup-config-webcomponent'"},{"note":"Named export 'config' is a sample config object, not the factory function.","wrong":null,"symbol":"config","correct":"import { config } from 'rollup-config-webcomponent'"}],"quickstart":{"code":"// rollup.config.js\nimport createConfig from 'rollup-config-webcomponent';\n\nexport default createConfig({\n  name: 'my-element',\n  input: './src/index.ts',\n});","lang":"typescript","description":"Shows minimal usage: import the factory function and pass options (name, input) to generate a Rollup config."},"warnings":[{"fix":"No action needed; warning is cosmetic. Wait for upstream fix.","message":"Accessing 'isAsset' on files in the bundle is deprecated, please use 'type === \"asset\"' instead. This warning originates from rollup-plugin-filesize and has no functional impact.","severity":"deprecated","affected_versions":">=0.0.1"},{"fix":"Ensure your tsconfig.json includes 'declaration: true' and set '--environment bundle' config accordingly.","message":"When 'bundle' environment is set, TypeScript declaration generation may be disabled if you don't configure it manually.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Install correct peer versions: 'npm install rollup@2 tslib@2.0'","message":"Package requires peer dependencies rollup@2.x and tslib@2.0.x. Using incompatible versions may cause build failures.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"If you need ES5 output, ensure ecma:5 is passed via environment or options.","message":"The config sets Babel as the transpiler; TypeScript is only used for type-checking and declaration generation. Target default is 'esnext', but Babel may not support all JS features.","severity":"gotcha","affected_versions":">=0.0.1"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run 'npm install rollup-config-webcomponent --save-dev'","cause":"Module not installed or not in node_modules path.","error":"Error: Cannot find module 'rollup-config-webcomponent'"},{"fix":"Use ES module import syntax: 'import createConfig from 'rollup-config-webcomponent''","cause":"Attempting to use CommonJS require on an ESM-only package.","error":"Cannot read property 'createConfig' of undefined"},{"fix":"Install tslib: 'npm install tslib@2.0'","cause":"Missing peer dependency tslib.","error":"Error: Could not resolve 'tslib'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}