A Rollup plugin that mimics webpack's externals configuration, allowing you to mark dependencies as external and provide global variable names for bundling with script tags. Currently at v0.0.1, it is a lightweight alternative to @rollup/plugin-node-resolve combined with manual external handling. It maps module IDs to global variable names, emitting `module.exports = window.VariableName` stubs at build time. Suitable for library authors bundling for browser environments. No dependencies and ships TypeScript types.
npm install rollup-plugin-externalsVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to use the externals plugin in a Rollup config to map 'react' and 'react-dom' to global variables for IIFE output.
Use `output.format: 'iife'` or ensure your output format supports global variable assignments.
For webpack, use built-in `externals` config; for esbuild, use `external` option with `globalName`.
Pin to exact version and test upgrades thoroughly.
Use `const { externals } = require('rollup-plugin-externals')` instead of `const externals = require('rollup-plugin-externals')`.Ensure rollup-plugin-externals is installed as a direct devDependency, and delete node_modules/.cache if needed.
Set Rollup's output.format to 'cjs' or 'iife' and ensure the target environment supports `module`.
No dependency data recorded yet.