rollup-plugin-di
A rollup plugin for DI - Compile-time reflection and dependency injection.
Installation
Simply do: npm install @wessberg/rollup-plugin-di
.
Usage
Add it to the plugins
array of your rollup configuration:
rollup({
plugins: [
DI(),
// Other plugins goes here...
]
});
Configuration
You can pass in the following options:
-
excludeFiles
:RegExp|RegExp[]|Set<RegExp>
- Files matching this or these regular expressions will be ignored.
-
shimGlobalObject
:boolean
- By default, the plugin will add a shim for the global object in top of your bundle. You may target an environment where global is defined already (such as Node), and if so, you can set this to
false
.
- By default, the plugin will add a shim for the global object in top of your bundle. You may target an environment where global is defined already (such as Node), and if so, you can set this to
See the documentation for more details on how to actually use DI.