diff options
| author | akiyamn | 2023-09-24 23:22:21 +1000 |
|---|---|---|
| committer | akiyamn | 2023-09-24 23:22:21 +1000 |
| commit | 4e87195739f2a5d9a05451b48773c8afdc680765 (patch) | |
| tree | 9cba501844a4a11dcbdffc4050ed8189561c55ed /node_modules/rollup-plugin-inject/README.md | |
| download | price-tracker-worker-4e87195739f2a5d9a05451b48773c8afdc680765.tar.gz price-tracker-worker-4e87195739f2a5d9a05451b48773c8afdc680765.zip | |
Initial commit (by create-cloudflare CLI)
Diffstat (limited to 'node_modules/rollup-plugin-inject/README.md')
| -rwxr-xr-x | node_modules/rollup-plugin-inject/README.md | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/node_modules/rollup-plugin-inject/README.md b/node_modules/rollup-plugin-inject/README.md new file mode 100755 index 0000000..8fadb16 --- /dev/null +++ b/node_modules/rollup-plugin-inject/README.md @@ -0,0 +1,59 @@ +# rollup-plugin-inject + +Scan modules for global variables and inject `import` statements where necessary + +## Archived (Migration to Mono-Repo In-Process) + +This repository has been archived and is in the process of being migrated to a new monorepo. Please bear with us as we make this transition. More information to follow. + +## Installation + +```bash +npm install --save-dev rollup-plugin-inject +``` + + +## Usage + +```js +import { rollup } from 'rollup'; +import inject from 'rollup-plugin-inject'; + +rollup({ + entry: 'main.js', + plugins: [ + inject({ + // control which files this plugin applies to + // with include/exclude + include: '**/*.js', + exclude: 'node_modules/**', + + /* all other options are treated as modules...*/ + + // use the default – i.e. insert + // import $ from 'jquery' + $: 'jquery', + + // use a named export – i.e. insert + // import { Promise } from 'es6-promise' + Promise: [ 'es6-promise', 'Promise' ], + + // use a namespace import – i.e. insert + // 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' ), + + /* ...but if you want to be careful about separating modules + from other options, supply `options.modules` instead */ + + modules: { + $: 'jquery', + Promise: [ 'es6-promise', 'Promise' ], + 'Object.assign': path.resolve( 'src/helpers/object-assign.js' ) + } + }) + ] +}).then(...) +``` |
