Registry / devops / rollup-copy-transform-css

rollup-copy-transform-css

JSON →
library2.2.0jsnpmunverified

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-css
INSTALL
IMPORT
SIG · ROLLUP-COPY-TRANSF
R
rollup-copy-transform-css
devopsjavascriptv2.2.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

createTransform
import { createTransform } from 'rollup-copy-transform-css'
const { createTransform } = require('rollup-copy-transform-css')
ESM-only since v2; CJS require may fail or produce undefined
default
import { createTransform } from 'rollup-copy-transform-css'
import createTransform from 'rollup-copy-transform-css'
No default export; only named export createTransform is available
copy plugin
import copy from 'rollup-plugin-copy'
import { copy } from 'rollup-plugin-copy'
rollup-plugin-copy uses default export

Basic Rollup config using rollup-plugin-copy with transform that minifies CSS and generates an external source map.

import copy from 'rollup-plugin-copy'; import { createTransform } from 'rollup-copy-transform-css'; const transformCss = createTransform({ inline: false, minify: true, map: { inline: false } }); export default { input: 'src/index.js', output: { file: 'dist/bundle.js', format: 'iife' }, plugins: [ copy({ targets: [ { src: 'src/styles/main.css', dest: 'dist/styles', transform: transformCss } ] }) ] };
Debug
Known issues
breakingNode.js 18 is required
fix
Upgrade Node.js to version 18 or later
affects: >=2.0.0
breakingESM-only: no CommonJS support
fix
Use import syntax instead of require; set type: 'module' in package.json
affects: >=2.0.0
gotchaExperimental esbuild engine may produce different output than PostCSS
fix
Set minify: { fast: true } or inline: { fast: true } to use esbuild; test output carefully
affects: >=1.0.0
gotchaSource map generation may be silently ignored if not explicitly configured
fix
Ensure map option is set to boolean or object in createTransform or transform call
affects: >=1.0.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module not supported
Using require() on this package which is ESM-only since v2
fix
Use dynamic import: const { createTransform } = await import('rollup-copy-transform-css');
TypeError: createTransform is not a function
Importing default export incorrectly instead of named export createTransform
fix
Use import { createTransform } from 'rollup-copy-transform-css'
Error: rollup-plugin-copy is not installed
Missing required peer dependency rollup-plugin-copy
fix
Install rollup-plugin-copy alongside this package: npm i -D rollup-plugin-copy
Upgrade
Version history
2.2.0latest on npm
Audit
Dependencies
rollup-plugin-copyrequiredpeer dependency; required as the primary copy plugin that uses the transforms generated by this package
Agent activity
8 hits · last 30 days
node
6
Resources
rollup-copy-transform-css — npm install rollup-copy-transform-css · libregistry