@wessberg/rollup-plugin-di

A rollup plugin for DI: https://www.npmjs.com/package/@wessberg/di - Compile-time reflection and dependency injection.


Keywords
DI, rollup, plugin, dependency injection, ioc, inversion, service, container, newable, reflection, singleton, transient
License
MIT
Install
npm install @wessberg/rollup-plugin-di@1.0.87

Documentation

rollup-plugin-di

NPM version License-mit

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.

See the documentation for more details on how to actually use DI.