MCPcopy Index your code
hub / github.com/ember-cli/ember-cli / configReplacePatterns

Function configReplacePatterns

lib/utilities/ember-app-utils.js:158–185  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

156 @return {Array} An array of patterns to match against and replace
157*/
158function configReplacePatterns(options) {
159 return [
160 {
161 match: /{{\s?rootURL\s?}}/g,
162 replacement(config) {
163 return normalizeUrl(config.rootURL);
164 },
165 },
166 {
167 match: /{{\s?EMBER_ENV\s?}}/g,
168 replacement(config) {
169 return convertObjectToString(config.EmberENV);
170 },
171 },
172 {
173 match: /{{content-for ['"](.+?)["']}}/g,
174 replacement(config, match, type) {
175 return contentFor(config, match, type, options);
176 },
177 },
178 {
179 match: /{{\s?MODULE_PREFIX\s?}}/g,
180 replacement(config) {
181 return config.modulePrefix;
182 },
183 },
184 ];
185}
186
187module.exports = { normalizeUrl, convertObjectToString, contentFor, configReplacePatterns };

Callers 5

processIndexMethod · 0.85
processTestIndexMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…