Rollup plugin utility for transforming CSS files during copy operations with rollup-plugin-copy. Current stable version is 2.2.0, released November 2025, with support for Rollup 2, 3, and 4. Provides CSS minification via cssnano or esbuild, stylesheet and asset inlining via postcss-import and postcss-url, and custom PostCSS plugin pipelines. Key differentiators: supports both PostCSS and esbuild engines for fast processing, integrates seamlessly with rollup-plugin-copy targets, and offers source map generation. Requires Node.js 18+ as of v2.0.0.
npm install rollup-copy-transform-cssVerified import paths — ran on the pinned version, not inferred.
Basic Rollup config using rollup-plugin-copy with transform that minifies CSS and generates an external source map.
Upgrade Node.js to version 18 or later
Use import syntax instead of require; set type: 'module' in package.json
Set minify: { fast: true } or inline: { fast: true } to use esbuild; test output carefullyEnsure map option is set to boolean or object in createTransform or transform call
Use dynamic import: const { createTransform } = await import('rollup-copy-transform-css');Use import { createTransform } from 'rollup-copy-transform-css'Install rollup-plugin-copy alongside this package: npm i -D rollup-plugin-copy