1 | # broccoli-config-replace
|
2 |
|
3 | Simple templating using a config.json and regex patterns.
|
4 |
|
5 | ```js
|
6 | new ConfigReplace(appNode, configNode, {
|
7 | // annotate the output. See broccoli-plugin
|
8 | annotations: true,
|
9 |
|
10 | // A list of files to parse:
|
11 | files: [
|
12 | 'index.html',
|
13 | 'tests/index.html'
|
14 | ],
|
15 |
|
16 | configPath: 'development.json',
|
17 | outputPath: 'dist/',
|
18 | patterns: [{
|
19 | match: /\{\{EMBER_ENV\}\}/g,
|
20 | replacement: function(config) { return config.EMBER_ENV; }
|
21 | }, {
|
22 | match: /\{\{APPLICATION_NAME\}\}/g,
|
23 | replacement: 'My Application'
|
24 | }]
|
25 | });
|
26 | ```
|
27 |
|
28 | If `replacement` is a function, it's passed the config object. Otherwise,
|
29 | do a simple string replacement.
|
30 |
|
31 | ## Running tests
|
32 |
|
33 | `npm test`
|