JSPM

broccoli-config-replace

1.1.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 333413
  • Score
    100M100P100Q175155F
  • License MIT

Simple templating using a config.json and regex patterns

Package Exports

  • broccoli-config-replace

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (broccoli-config-replace) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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