* @param {string} identifierName the identifier name to replace * @param {boolean|string} value the value to replace with * @return {!Object} replacement options used by minify-replace plugin
(identifierName, value)
| 37 | * @return {!Object} replacement options used by minify-replace plugin |
| 38 | */ |
| 39 | function createReplacement(identifierName, value) { |
| 40 | const replacement = |
| 41 | typeof value === 'boolean' |
| 42 | ? {type: 'booleanLiteral', value} |
| 43 | : {type: 'stringLiteral', value}; |
| 44 | return {identifierName, replacement}; |
| 45 | } |
| 46 | |
| 47 | const constants = Object.assign({}, BUILD_CONSTANTS, opt_overrides); |
| 48 | const replacements = Object.entries(constants).map(([ident, val]) => |