REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 2.71 KB
Close
/proc/thread-self/root/home/byroehnu/.trash/node_modules11/@rollup/plugin-inject/README.md
Text
Base64
[npm]: https://img.shields.io/npm/v/@rollup/plugin-inject [npm-url]: https://www.npmjs.com/package/@rollup/plugin-inject [size]: https://packagephobia.now.sh/badge?p=@rollup/plugin-inject [size-url]: https://packagephobia.now.sh/result?p=@rollup/plugin-inject [![npm][npm]][npm-url] [![size][size]][size-url] [](https://liberamanifesto.com) # @rollup/plugin-inject 🍣 A Rollup plugin which scans modules for global variables and injects `import` statements where necessary. ## Requirements This plugin requires an [LTS](https://github.com/nodejs/Release) Node version (v14.0.0+) and Rollup v1.20.0+. ## Install Using npm: ```console npm install @rollup/plugin-inject --save-dev ``` ## Usage Create a `rollup.config.js` [configuration file](https://www.rollupjs.org/guide/en/#configuration-files) and import the plugin: ```js import inject from '@rollup/plugin-inject'; export default { input: 'src/index.js', output: { dir: 'output', format: 'cjs' }, plugins: [ inject({ Promise: ['es6-promise', 'Promise'] }) ] }; ``` Then call `rollup` either via the [CLI](https://www.rollupjs.org/guide/en/#command-line-reference) or the [API](https://www.rollupjs.org/guide/en/#javascript-api). This configuration above will scan all your files for global Promise usage and plugin will add import to desired module (`import { Promise } from 'es6-promise'` in this case). Examples: ```js { // import { Promise } from 'es6-promise' Promise: [ 'es6-promise', 'Promise' ], // import { Promise as P } from 'es6-promise' P: [ 'es6-promise', 'Promise' ], // import $ from 'jquery' $: 'jquery', // import * as fs from 'fs' fs: [ 'fs', '*' ], // use a local module instead of a third-party one 'Object.assign': path.resolve( 'src/helpers/object-assign.js' ), } ``` Typically, `@rollup/plugin-inject` should be placed in `plugins` _before_ other plugins so that they may apply optimizations, such as dead code removal. ## Options In addition to the properties and values specified for injecting, users may also specify the options below. ### `exclude` Type: `String` | `Array[...String]`<br> Default: `null` A [picomatch pattern](https://github.com/micromatch/picomatch), or array of patterns, which specifies the files in the build the plugin should _ignore_. By default no files are ignored. ### `include` Type: `String` | `Array[...String]`<br> Default: `null` A [picomatch pattern](https://github.com/micromatch/picomatch), or array of patterns, which specifies the files in the build the plugin should operate on. By default all files are targeted. ## Meta [CONTRIBUTING](/.github/CONTRIBUTING.md) [LICENSE (MIT)](/LICENSE)
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 2 × Files: 2
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
dist
DIR
-
drwxr-xr-x
2026-02-28 00:26:50
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
types
DIR
-
drwxr-xr-x
2026-02-28 00:27:34
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
package.json
2.17 KB
lrw-r--r--
2026-02-28 00:27:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
README.md
2.71 KB
lrw-r--r--
2026-02-28 00:27:26
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).