rollup-plugin-auto-transform

raw JSON →
1.0.2 verified Mon Apr 27 auth: no javascript maintenance

An automatic transform plugin for Rollup that mimics Browserify's transform resolution by reading the `browserify.transform` key in package.json. As of version 1.0.2 (stable, single release), it simplifies applying Browserify transforms (e.g., brfs, envify) to Rollup bundles without manual configuration. Unlike manual plugin arrays, it reads transforms from package.json automatically, reducing setup duplication. No active development since 2017; considered feature-complete for its narrow use case. Alternative: use Rollup plugins directly or @rollup/plugin-commonjs for broader compatibility.

error Cannot find module 'rollup-plugin-auto-transform'
cause Package not installed or import path incorrect.
fix
Run npm install rollup-plugin-auto-transform and ensure import is correct: import autoTransform from 'rollup-plugin-auto-transform'
error TypeError: autoTransform is not a function
cause Using named import instead of default import.
fix
Use default import: import autoTransform from 'rollup-plugin-auto-transform' instead of import { autoTransform } from...
error Error: Could not resolve 'your-transform' from .../
cause Transform package not installed but listed in package.json.
fix
Install the transform package (e.g., npm install brfs) or remove it from 'browserify.transform'.
deprecated Package is no longer actively maintained; last release in 2017.
fix Consider using direct Rollup plugins (e.g., @rollup/plugin-commonjs, rollup-plugin-babel) or @rollup/plugin-node-resolve for better compatibility.
gotcha Transforms must be listed under 'browserify.transform' in package.json; other keys are ignored.
fix Ensure your package.json has a 'browserify.transform' array. Example: { "browserify": { "transform": ["brfs"] } }
gotcha Transforms are applied globally, not per-file; may cause unexpected behavior with non-Browserify transforms.
fix Review each transform's compatibility with Rollup. Some Browserify transforms rely on Node.js streams or other Browserify internals.
npm install rollup-plugin-auto-transform
yarn add rollup-plugin-auto-transform
pnpm add rollup-plugin-auto-transform

Shows how to use the plugin to automatically apply Browserify transforms defined in package.json to a Rollup bundle.

import autoTransform from 'rollup-plugin-auto-transform';
import { rollup } from 'rollup';

const bundle = await rollup({
  input: 'src/index.js',
  plugins: [
    autoTransform()
  ]
});

const { output } = await bundle.generate({ format: 'esm' });
console.log(output[0].code);