{"name":"babel-plugin-minify-replace","version":"0.5.0-alpha.36b27d42","description":"Configurable \"search and replace\" plugin. Replaces matching nodes in the tree with a given replacement node. For example you can replace `process.NODE_ENV` with `\"production\"`.","keywords":["babel-plugin"],"homepage":"https://github.com/babel/minify#readme","bugs":{"url":"https://github.com/babel/minify/issues"},"license":"MIT","author":{"name":"amasad"},"main":"lib/index.js","repository":{"type":"git","url":"https://github.com/babel/minify/tree/master/packages/babel-plugin-minify-replace"},"readmeFilename":"README.md","readme":"# babel-plugin-minify-replace\n\nConfigurable \"search and replace\" plugin. Replaces matching nodes in the tree with a given replacement node. For example you can replace `process.NODE_ENV` with `\"production\"`.\n\n## Example\n\n**Options**\n\n```javascript\n[\n  {\n    identifierName: \"__DEV__\",\n    replacement: {\n      type: \"numericLiteral\",\n      value: 0,\n    },\n  },\n]\n```\n\n**In**\n\n```javascript\nif (!__DEV__) {\n  foo();\n}\nif (a.__DEV__) {\n  foo();\n}\n```\n\n**Out**\n\n```javascript\nif (!0) {\n  foo();\n}\nif (a.__DEV__) {\n  foo();\n}\n```\n\n## Installation\n\n```sh\nnpm install babel-plugin-minify-replace --save-dev\n```\n\n## Usage\n\n### Via `.babelrc` (Recommended)\n\n**.babelrc**\n\n```json\n// without options\n{\n  \"plugins\": [\"minify-replace\"]\n}\n```\n\n```json\n// with options\n{\n  \"plugins\": [\n    [\"minify-replace\", {\n      \"replacements\": [{\n        \"identifierName\": \"__DEV__\",\n        \"replacement\": {\n          \"type\": \"booleanLiteral\",\n          \"value\": true\n        }\n      }]\n    }]\n  ]\n}\n```\n\n### Via CLI\n\n```sh\nbabel --plugins minify-replace script.js\n```\n\n### Via Node API\n\n```javascript\nrequire(\"@babel/core\").transform(\"code\", {\n  plugins: [\"minify-replace\"]\n});\n```\n","_id":"babel-plugin-minify-replace@0.5.0-alpha.36b27d42","dist":{"shasum":"07020ac1cb76afe65d8e41297fdb1755970db0f6","tarball":"http://registry-npm.ywwl.com/babel-plugin-minify-replace/download/babel-plugin-minify-replace-0.5.0-alpha.36b27d42.tgz","fileCount":5,"unpackedSize":3982,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa/JBPCRA9TVsSAnZWagAAoC0QAJv9BFOFo8gHufUr1HmH\nMMKyVVYUmAy95OLgMG7SICCImnJugp9h0YPG0geJ91JTAphIEtafwhPctcWu\nEkNUDcHtsr0CrTSgFJ22N0/WoQ6MIBBARks9CT85Gs9ekV8kSIslhLedgMNA\nW5KSoUDZ24f3N8IEecdlD1EUFykjMvPluPcTTg13Fq0xMXU2c0GQoQ3Mao6R\nGZLdp7wY1ngMh9sXYjG0G0HQhNGbLLXTadvD0nXQ6V5aqU+S1weH7QmFfcei\nz7jUetftjFbu0cTHpWjrf1Wsnz6ZlhbM6dSDXR6b0tZhdsl/Ou+84zMUMd+0\nBOHzQORf3GwJ4HaZ73L/KahhWjnIaJTnmdLgj7A4FRqsrB/8kbI5lHw13G1y\nzyIrv6S+PW5dUEolZYP90sLsLuMNps+vrzw3nSLk+zoffGR2n7jwpTO0DL9X\ngEbW1JEcwPbOIPeRD40f9ytU2sd5AeezxAbVytx5oiL8ytyAZe2evg+7PO3e\nNu09Jr0qT94tqj5IGbsjeI1Z7fW3ThlnEuQRLy8VNnOZpWpMEAY1JGdkMbQL\nE6fsiCOFxup/QPuV0YxfhrM6+zNYGqUfLW50AOe8O/K0Z8cGcFfWc7MITZOR\n/kydgFqBmt4LAj255NlgISpOSWrbVjfBmTIoLSd53L2Kv5ZmwGFGgWMr1PKK\nw3cV\r\n=OyWt\r\n-----END PGP SIGNATURE-----\r\n","integrity":"sha512-/tTgTVagUCSMFdKURnMkeBClhEdrXZzivUmpkOFUOuLA+qhtNJZg0tB8aCQF0TyNFz307H1So9oC2qMDKZlqAw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICbJwAA18aZMmD0bEF5Lzqe1fA0J6GuDAD1DOO1DfTx0AiEA5FhLKhQtzeZ/FeI6BbWV0+tb2yLR5WFMCIKy+m+D5hU="}],"size":1683,"noattachment":false,"key":"/babel-plugin-minify-replace/-/babel-plugin-minify-replace-0.5.0-alpha.36b27d42.tgz"},"maintainers":[{"email":"asciiguyfieri@gmail.com","name":"babeljs"},{"email":"me@boopathi.in","name":"boopathi"},{"email":"hi@henryzoo.com","name":"hzoo"},{"email":"loganfsmyth@gmail.com","name":"loganfsmyth"},{"email":"vignesh.shanmugam22@gmail.com","name":"vignesh.shanmugam"}],"_npmUser":{"name":"babeljs","email":"asciiguyfieri@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/babel-plugin-minify-replace_0.5.0-alpha.36b27d42_1526501455088_0.19783906398478002"},"_hasShrinkwrap":false,"publish_time":1526501455148,"_cnpm_publish_time":1526501455148,"dist-tags":{"canary":"0.5.0-alpha.9","latest":"0.5.0"}}