{"library":"rollup-plugin-externals","title":"rollup-plugin-externals","description":"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.","language":"javascript","status":"active","last_verified":"Mon Apr 27","install":{"commands":["npm install rollup-plugin-externals"],"cli":null},"imports":["import { externals } from 'rollup-plugin-externals'","const { externals } = require('rollup-plugin-externals')","import type { ExternalsOptions } from 'rollup-plugin-externals'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { defineConfig } from 'rollup';\nimport { externals } from 'rollup-plugin-externals';\n\nexport default defineConfig({\n  input: 'src/index.js',\n  output: {\n    dir: 'dist',\n    format: 'iife',\n  },\n  plugins: [\n    externals({\n      'react': 'React',\n      'react-dom': 'ReactDOM',\n    }),\n  ],\n});","lang":"typescript","description":"Demonstrates how to use the externals plugin in a Rollup config to map 'react' and 'react-dom' to global variables for IIFE output.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}