definePlugin method

void definePlugin (
  1. String name,
  2. Plugin plugin,
  3. {bool load: false,
  4. String options: ''}
)

Define a custom plugin named name and load it if load is true

It is a helper for modifyOptions in less.transform

Example1: definePlugin('myPlugin', new MyPlugin()); Exmaple2: definePlugin('myPlugin', new MyPlugin(), true, '');

Implementation

void definePlugin(String name, Plugin plugin,
    {bool load = false, String options = ''}) {
  pluginLoader.define(name, plugin);

  if (load) {
    final pluginLoaded = pluginLoader.tryLoadPlugin(name, options);
    if (pluginLoaded != null) plugins.add(pluginLoaded);
  }
}