Git Product home page Git Product logo

ember-cli-preprocess-registry's Introduction

ember-cli-preprocessor-registry

Used by Ember CLI to provide a registry of preprocessors. The main types used throughout the system are css, template, js.

Addon Usage

You can access both your own addon's and your parent's (whichever item is including you) registry via the setupPreprocessorRegistry hook in your addon's index.js.

Example:

module.exports = {
  name: 'special-js-sauce',
  
  setupPreprocessorRegistry(type, registry) {
    if (type !== 'parent') { return; }

    registry.add('js', {
      name: 'special-js-sauce-preprocessor',
      toTree() {
        // do your thing here....
      }
    });
  }
}

API

Registry.prototype.add(type: String, plugin: Plugin)

Adds the provided plugin to the registry for the type specified.

Example:

class SpecialSauce {
  get name() { return 'special-sauce'; }

  toTree(tree) {
    // return new tree after processing
  }
}

registry.add('js', new SpecialSauce);

Registry.prototype.load(type: String): Plugin[]

Returns an array of all plugins that are registered for a given type.

Registry.prototype.extensionsForType(type: String): string[]

Returns an array of all known extensions for a given type.

Registry.prototype.remove(type: String, plugin: Plugin)

Removes the provided plugin from the specified type listing.

Running Tests

npm install
npm test

ember-cli-preprocess-registry's People

Contributors

2hu12 avatar btecu avatar chadhietala avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar greenkeeperio-bot avatar jcope2013 avatar locks avatar rwjblue avatar stefanpenner avatar turbo87 avatar tylergibson avatar webark avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.