{"id":22258,"library":"rollup-plugin-thunder","title":"rollup-plugin-thunder","description":"A Rollup plugin for LightningCSS, providing CSS transformation, minification, and module support. Current stable version 2.0.1 (September 2025) with regular updates. Key differentiators: seamless integration with Rollup, auto CSS modules via naming conventions, and support for CSSStyleSheet. ESM-only, TypeScript-friendly with bundled types.","status":"active","version":"2.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/plumelo/rollup-plugin-thunder","tags":["javascript","rollup","plugin","lightningcss"],"install":[{"cmd":"npm install rollup-plugin-thunder","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-thunder","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-thunder","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core CSS processing engine","package":"lightningcss","optional":false},{"reason":"Module resolution for CSS imports","package":"enhanced-resolve","optional":false}],"imports":[{"note":"Default import. CommonJS require will fail; ESM-only since v1.","wrong":"const thunder = require('rollup-plugin-thunder')","symbol":"thunder","correct":"import thunder from 'rollup-plugin-thunder'"},{"note":"Named export for CSS class list. Spelling is intentional: 'clasess' (double s). Breaking change in v2.0.0.","wrong":"import { classes } from 'rollup-plugin-thunder'","symbol":"clasess","correct":"import { clasess } from 'rollup-plugin-thunder'"},{"note":"Shorthand named export for clasess (available since v2.0.0).","wrong":"","symbol":"C","correct":"import { C } from 'rollup-plugin-thunder'"},{"note":"Type import for TypeScript users. Only available as type, not runtime value.","wrong":"import { Options } from 'rollup-plugin-thunder'","symbol":"type Options","correct":"import type { Options } from 'rollup-plugin-thunder'"}],"quickstart":{"code":"import thunder from 'rollup-plugin-thunder';\n\nexport default {\n  input: 'src/index.css',\n  plugins: [\n    thunder({\n      minify: true,\n      sourceMap: true,\n      modules: true,\n      autoModules: /\\\\.module\\\\.css$/,\n    }),\n  ],\n  output: {\n    dir: 'dist',\n    format: 'esm',\n  },\n};\n","lang":"typescript","description":"Configures Rollup with Thunder plugin for CSS processing: minification, source maps, CSS modules, and auto-module detection."},"warnings":[{"fix":"Change imports to use 'clasess' or 'C' instead of 'classes'.","message":"Export class list as `clasess` and shorthand `C` named export. Previous `classes` export removed.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Pin exact version and review changelog for option changes.","message":"Options may change in future minor versions without major semver bump.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Use correct spelling 'clasess' or shorthand 'C'.","message":"The 'clasess' export name is intentionally misspelled. Expect typos in user code.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Use dynamic import or ensure project is ESM.","message":"Plugin is ESM-only. CommonJS require() throws error.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Disable 'autoModules' or customize regex to avoid overlap.","message":"CSS modules auto-detection may conflict with other CSS plugins (e.g., postcss).","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use dynamic import: const thunder = await import('rollup-plugin-thunder');","cause":"Using CommonJS require() to import an ESM-only package.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module not supported."},{"fix":"Use 'clasess' or 'C' instead of 'classes'.","cause":"Named export 'classes' was renamed to 'clasess' in v2.0.0.","error":"Module '\"rollup-plugin-thunder\"' has no exported member 'classes'."},{"fix":"Use default import: import thunder from 'rollup-plugin-thunder'","cause":"Default import used as function but imported as named export.","error":"TypeError: thunder is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}