Registry / devops / rollup-globals-regex

rollup-globals-regex

JSON →
library0.0.3jsnpmunverified

A Rollup plugin utility to define globals using RegExp patterns, reducing boilerplate for Angular, RxJS, and other scoped packages. Versions 0.0.x, no recent releases, single maintainer. Converts simple globals object from explicit mappings to regex-based pattern matching with optional transformers like kebab-to-camelCase. Ships TypeScript definitions. Not actively maintained but stable for basic usage.

npm install rollup-globals-regex
INSTALL
IMPORT
SIG · ROLLUP-GLOBALS-REG
R
rollup-globals-regex
devopsjavascriptv0.0.3
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.

globalsRegex
import { globalsRegex } from 'rollup-globals-regex'
const globalsRegex = require('rollup-globals-regex')
Package is ESM-first; CommonJS require may not work depending on bundler configuration.
GLOBAL
import { GLOBAL } from 'rollup-globals-regex'
GLOBAL is an object containing predefined regex patterns; property names are uppercase strings.
GlobalsRegexTransformer
import type { GlobalsRegexTransformer } from 'rollup-globals-regex'
import { GlobalsRegexTransformer } from 'rollup-globals-regex' (if not used at runtime)
TypeScript users should use type import to avoid runtime error if transformers are not exported as values.

Shows how to configure Rollup globals using regex patterns for Angular and RxJS packages.

import { globalsRegex, GLOBAL } from 'rollup-globals-regex'; export default { input: 'src/index.js', output: { file: 'dist/bundle.js', format: 'iife', name: 'MyBundle', globals: globalsRegex({ 'jquery': '$', 'lodash': '_', [GLOBAL.NG2]: GLOBAL.NG2.TPL, [GLOBAL.RX]: GLOBAL.RX.TPL, }) }, external: ['jquery', 'lodash', '@angular/core', '@angular/common', 'rxjs'] };
Debug
Known issues
deprecatedPackage is not actively maintained; last release 6+ years ago. Consider alternatives like @rollup/plugin-commonjs or custom globals functions.
fix
Migrate to manual globals mapping or use Rollup's built-in globals option with a function.
affects: >=0.0.0
gotchaGLOBAL.NG2.TPL applies kebab-to-camelCase transformer; ensure your Angular package names use kebab-case (e.g., '@angular/platform-browser').
fix
Double-check transformer behavior or define custom regex patterns without transformers.
affects: >=0.0.0
gotchaUsing computed property keys with GLOBAL symbols may cause TypeScript errors if no index signature is defined; cast to 'any' if needed.
fix
// @ts-ignore or (globalsRegex as any)({ ... })
affects: >=0.0.0
gotchaThe package does not export types for GLOBAL properly; TypeScript users may need to declare module augmentations.
fix
Install @types/rollup-globals-regex manually (if available) or declare module 'rollup-globals-regex' { ... } in a .d.ts file.
affects: >=0.0.0
Errors
Common errors & fixes
Cannot find module 'rollup-globals-regex'
Package not installed or npm install failed.
fix
npm install rollup-globals-regex --save-dev
Module 'rollup-globals-regex' has no exported member 'GLOBAL'
Using incorrect import path or TypeScript version mismatch.
fix
Ensure import is correct: import { GLOBAL } from 'rollup-globals-regex'. If using TS <3.8, use import GLOBAL = require('rollup-globals-regex').GLOBAL
TypeError: globalsRegex is not a function
CommonJS require used incorrectly; package is ESM only.
fix
Use ES module import: import { globalsRegex } from 'rollup-globals-regex' or if using CommonJS, try dynamic import: const { globalsRegex } = await import('rollup-globals-regex')
The requested module 'rollup-globals-regex' does not provide an export named 'GLOBAL' (in Node ESM)
Node.js ESM requires explicit .mjs extension or package.json 'type':'module'.
fix
Add 'type':'module' to your package.json or rename file to .mjs. Alternatively use --experimental-modules flag.
Upgrade
Version history
0.0.3latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
4
Resources
rollup-globals-regex — npm install rollup-globals-regex · libregistry