broccoli-config-replace
Simple templating using a config.json and regex patterns
Last updated 4 years ago by stefanpenner .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install broccoli-config-replace 
SYNC missed versions from official npm registry.

broccoli-config-replace Build Status

Simple templating using a config.json and regex patterns.

new ConfigReplace(appNode, configNode, {
  // annotate the output. See broccoli-plugin
  annotations: true,

  // A list of files to parse:
  files: [
    'index.html',
    'tests/index.html'
  ],

  configPath: 'development.json',
  outputPath: 'dist/',
  patterns: [{
    match: /\{\{EMBER_ENV\}\}/g,
    replacement: function(config) { return config.EMBER_ENV; }
  }, {
    match: /\{\{APPLICATION_NAME\}\}/g,
    replacement: 'My Application'
  }]
});

If replacement is a function, it's passed the config object. Otherwise, do a simple string replacement.

Running tests

npm test

Current Tags

  • 1.1.2                                ...           latest (4 years ago)

4 Versions

  • 1.1.2                                ...           4 years ago
  • 1.1.1                                ...           4 years ago
  • 1.1.0                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Downloads
Today 1
This Week 49
This Month 28
Last Day 6
Last Week 66
Last Month 255
Dependencies (4)
Dev Dependencies (4)

Copyright 2014 - 2016 © taobao.org |