{"name":"babel-plugin-minify-replace","version":"0.3.0-alpha.d9c99d3f","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"},"_id":"babel-plugin-minify-replace@0.3.0-alpha.d9c99d3f","_npmVersion":"5.5.1","_nodeVersion":"8.9.3","_npmUser":{"name":"babeljs","email":"asciiguyfieri@gmail.com"},"dist":{"integrity":"sha512-u1UAWe34t6Lln40LjGSQ1yePBRw6BLrXgBpd3CrKtWJgjgUwEVMp7BwErWvnMW2pIc85A44JF9neo03HNRyFwg==","shasum":"745f2e53f7bd3a38e857345e52cc53e6fd6357b1","tarball":"http://registry-npm.ywwl.com/babel-plugin-minify-replace/download/babel-plugin-minify-replace-0.3.0-alpha.d9c99d3f.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBXRUpY4k64K5r1K5pkCxT81fpGTZstB8/CQM57Vpq9HAiA+1OJ7tkRZz/3jZvxIfOH+P/g8I9+6KDiA/xuRfTUhbw=="}],"size":1619,"noattachment":false,"key":"/babel-plugin-minify-replace/-/babel-plugin-minify-replace-0.3.0-alpha.d9c99d3f.tgz"},"maintainers":[{"email":"asciiguyfieri@gmail.com","name":"babeljs"},{"email":"loganfsmyth@gmail.com","name":"loganfsmyth"},{"email":"vignesh.shanmugam22@gmail.com","name":"vignesh.shanmugam"},{"email":"hi@henryzoo.com","name":"hzoo"},{"email":"me@boopathi.in","name":"boopathi"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/babel-plugin-minify-replace-0.3.0-alpha.d9c99d3f.tgz_1513759140911_0.542543136747554"},"directories":{},"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","publish_time":1513759141822,"_cnpm_publish_time":1513759141822,"dist-tags":{"canary":"0.5.0-alpha.9","latest":"0.5.0"}}