{"_id":"babel-plugin-global-define","_rev":"348806","name":"babel-plugin-global-define","description":"The GlobalDefine plugin allows you to create global constants which is similar to Webpack's DefinePlugin.","dist-tags":{"latest":"1.0.3"},"maintainers":[{"name":"zheng_refn","email":"512557403@qq.com"}],"time":{"modified":"2021-07-13T07:46:27.000Z","created":"2018-01-31T07:38:39.512Z","1.0.3":"2018-02-01T05:14:05.369Z","1.0.2":"2018-02-01T02:57:46.975Z","1.0.1":"2018-01-31T08:07:33.993Z","1.0.0":"2018-01-31T07:38:39.512Z"},"users":{},"author":{"name":"ZhaZhengRefn"},"repository":{"type":"git","url":"git+https://github.com/ZhaZhengRefn/babel-plugin-global-define.git"},"versions":{"1.0.3":{"name":"babel-plugin-global-define","version":"1.0.3","description":"The GlobalDefine plugin allows you to create global constants which is similar to Webpack's DefinePlugin.","main":"lib","scripts":{"build":"babel ./src -d lib","clean":"rimraf lib/"},"repository":{"type":"git","url":"git+https://github.com/ZhaZhengRefn/babel-plugin-global-define.git"},"engines":{"node":">= 6.x.x"},"keywords":["babel-plugin","define","global-define","DefinePlugin"],"author":{"name":"ZhaZhengRefn"},"license":"MIT","bugs":{"url":"https://github.com/ZhaZhengRefn/babel-plugin-global-define/issues"},"homepage":"https://github.com/ZhaZhengRefn/babel-plugin-global-define#readme","devDependencies":{"babel":"^6.23.0","babel-cli":"^6.26.0","babel-core":"^6.26.0","babel-preset-es2015":"^6.24.1","rimraf":"^2.6.2"},"gitHead":"eeeb9cab2a41407a235dd61845205988fbb587a1","_id":"babel-plugin-global-define@1.0.3","_npmVersion":"5.4.2","_nodeVersion":"8.7.0","_npmUser":{"name":"zheng_refn","email":"512557403@qq.com"},"dist":{"shasum":"262c528f0c26bf318f4ccc77cf21df43a0fa6308","size":1286,"noattachment":false,"key":"/babel-plugin-global-define/-/babel-plugin-global-define-1.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/babel-plugin-global-define/download/babel-plugin-global-define-1.0.3.tgz"},"maintainers":[{"name":"zheng_refn","email":"512557403@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/babel-plugin-global-define-1.0.3.tgz_1517462045282_0.5852734697982669"},"directories":{},"publish_time":1517462045369,"_hasShrinkwrap":false,"_cnpm_publish_time":1517462045369},"1.0.2":{"name":"babel-plugin-global-define","version":"1.0.2","description":"The GlobalDefine plugin allows you to create global constants which is similar to Webpack's DefinePlugin.","main":"lib","scripts":{"build":"babel ./src -d lib","clean":"rimraf lib/"},"repository":{"type":"git","url":"git+https://github.com/ZhaZhengRefn/babel-plugin-global-define.git"},"engines":{"node":">= 6.x.x"},"keywords":["babel-plugin","define","global-define","DefinePlugin"],"author":{"name":"ZhaZhengRefn"},"license":"MIT","bugs":{"url":"https://github.com/ZhaZhengRefn/babel-plugin-global-define/issues"},"homepage":"https://github.com/ZhaZhengRefn/babel-plugin-global-define#readme","devDependencies":{"babel":"^6.23.0","babel-cli":"^6.26.0","babel-core":"^6.26.0","babel-preset-es2015":"^6.24.1","rimraf":"^2.6.2"},"gitHead":"9c182f0d85e0019c58ae44cd53a82018ce1d244c","_id":"babel-plugin-global-define@1.0.2","_npmVersion":"5.4.2","_nodeVersion":"8.7.0","_npmUser":{"name":"zheng_refn","email":"512557403@qq.com"},"dist":{"shasum":"372dc4d39dedebb8ed382450427ee1ec89567a53","size":1263,"noattachment":false,"key":"/babel-plugin-global-define/-/babel-plugin-global-define-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/babel-plugin-global-define/download/babel-plugin-global-define-1.0.2.tgz"},"maintainers":[{"name":"zheng_refn","email":"512557403@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/babel-plugin-global-define-1.0.2.tgz_1517453866904_0.3019164453726262"},"directories":{},"publish_time":1517453866975,"_hasShrinkwrap":false,"_cnpm_publish_time":1517453866975},"1.0.1":{"name":"babel-plugin-global-define","version":"1.0.1","description":"The GlobalDefine plugin allows you to create global constants which is similar to Webpack's DefinePlugin.","main":"lib","scripts":{"build":"babel ./src -d lib","clean":"rimraf lib/"},"repository":{"type":"git","url":"git+https://github.com/ZhaZhengRefn/babel-plugin-global-define.git"},"engines":{"node":">= 6.x.x"},"keywords":["babel-plugin","define","global-define","DefinePlugin"],"author":{"name":"ZhaZhengRefn"},"license":"MIT","bugs":{"url":"https://github.com/ZhaZhengRefn/babel-plugin-global-define/issues"},"homepage":"https://github.com/ZhaZhengRefn/babel-plugin-global-define#readme","devDependencies":{"babel":"^6.23.0","babel-cli":"^6.26.0","babel-core":"^6.26.0","babel-preset-es2015":"^6.24.1","rimraf":"^2.6.2"},"gitHead":"a80588148305e0167eface915d172c403ff3c765","_id":"babel-plugin-global-define@1.0.1","_npmVersion":"5.4.2","_nodeVersion":"8.7.0","_npmUser":{"name":"zheng_refn","email":"512557403@qq.com"},"dist":{"shasum":"53f23cc90fed0391f971dbf01aecab720aa5b956","size":1060,"noattachment":false,"key":"/babel-plugin-global-define/-/babel-plugin-global-define-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/babel-plugin-global-define/download/babel-plugin-global-define-1.0.1.tgz"},"maintainers":[{"name":"zheng_refn","email":"512557403@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/babel-plugin-global-define-1.0.1.tgz_1517386053903_0.9249753209296614"},"directories":{},"publish_time":1517386053993,"_hasShrinkwrap":false,"_cnpm_publish_time":1517386053993},"1.0.0":{"name":"babel-plugin-global-define","version":"1.0.0","description":"The GlobalDefine plugin allows you to create global constants which is similar to Webpack's DefinePlugin.","main":"lib","scripts":{"build":"babel ./src -d lib","clean":"rimraf lib/"},"repository":{"type":"git","url":"git+https://github.com/ZhaZhengRefn/babel-plugin-global-define.git"},"engines":{"node":">= 6.x.x"},"keywords":["babel-plugin","define","global-define","DefinePlugin"],"author":{"name":"ZhaZhengRefn"},"license":"MIT","bugs":{"url":"https://github.com/ZhaZhengRefn/babel-plugin-global-define/issues"},"homepage":"https://github.com/ZhaZhengRefn/babel-plugin-global-define#readme","devDependencies":{"babel-cli":"^6.26.0","babel-core":"^6.26.0","babel-preset-es2015":"^6.24.1","rimraf":"^2.6.2"},"gitHead":"a80588148305e0167eface915d172c403ff3c765","_id":"babel-plugin-global-define@1.0.0","_npmVersion":"5.4.2","_nodeVersion":"8.7.0","_npmUser":{"name":"zheng_refn","email":"512557403@qq.com"},"dist":{"shasum":"52eefb682800ddf6a1171956ae7cf2613496493a","size":925,"noattachment":false,"key":"/babel-plugin-global-define/-/babel-plugin-global-define-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/babel-plugin-global-define/download/babel-plugin-global-define-1.0.0.tgz"},"maintainers":[{"name":"zheng_refn","email":"512557403@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/babel-plugin-global-define-1.0.0.tgz_1517384319389_0.6688928927760571"},"directories":{},"publish_time":1517384319512,"_hasShrinkwrap":false,"_cnpm_publish_time":1517384319512}},"readme":"# babel-plugin-global-define\nThe GlobalDefine plugin allows you to create global constants which is similar to Webpack's DefinePlugin\n\n## Usage\n\n### install\n``` javascript\nnpm i babel-plugin-global-define --save-dev\n``` \n### .babelrc\n``` javascript\n{\n  \"plugins\": [\n    [\"global-define\", {\n      \"__ENV__\": \"production\",\n    }]\n  ]\n}\n```\n### Node API\n``` javascript\nrequire(\"babel-core\").transform(\"foo();\", {\n    plugins: [\n        [\"global-define\", { \"__ENV__\": \"production\" }]\n    ]}\n})\n```\n\n## Example\n\n### In\n```javascript\nconst hosts = {\n    development: 'https://test.github.com/',\n    production: 'https://www.github.com/'\n}\nconst currentHost = hosts[__ENV__]\n````\n### Out\n```javascript\nconst hosts = {\n    development: 'https://test.github.com/',\n    production: 'https://www.github.com/'\n}\nconst currentHost = hosts[\"production\"]\n````\n","_attachments":{},"homepage":"https://github.com/ZhaZhengRefn/babel-plugin-global-define#readme","bugs":{"url":"https://github.com/ZhaZhengRefn/babel-plugin-global-define/issues"},"license":"MIT"}