{"_id":"babel-plugin-module-rewrite","_rev":"9-a1d8bb92224d6df579bb9b1720d6790b","name":"babel-plugin-module-rewrite","description":"Babel plugin to dynamically rewrite the path in require() and ES6 import","dist-tags":{"latest":"0.2.0"},"versions":{"0.0.1":{"name":"babel-plugin-module-rewrite","version":"0.0.1","main":"lib/index.js","description":"Babel plugin to dynamically rewrite the path in require() and ES6 import","repository":{"type":"git","url":"git+https://github.com/liady/babel-plugin-module-rewrite.git"},"author":{"name":"Liad Yosef"},"license":"MIT","keywords":["babel","babel-plugin","module","rewrite","resolve","dynamic","rename","require","import"],"dependencies":{},"devDependencies":{"babel-cli":"^6.10.1","babel-core":"^6.8.0","babel-preset-es2015":"^6.6.0","babel-register":"^6.8.0","cross-env":"^1.0.8","mocha":"^2.5.0"},"scripts":{"compile":"cross-env NODE_ENV=production babel src --out-dir lib","test":"cross-env NODE_ENV=test npm run test:suite","test:suite":"mocha --compilers js:babel-register","test:watch":"npm run test:suite -- -w","prepublish":"npm run compile"},"gitHead":"4965f5b02e41b6815916f5a1832176b493654a5d","bugs":{"url":"https://github.com/liady/babel-plugin-module-rewrite/issues"},"homepage":"https://github.com/liady/babel-plugin-module-rewrite#readme","_id":"babel-plugin-module-rewrite@0.0.1","_shasum":"0c90bc6a78ac41ffeaae7e57590dfc62d3888473","_from":".","_npmVersion":"3.9.3","_nodeVersion":"6.2.1","_npmUser":{"name":"liady","email":"liadydev@gmail.com"},"dist":{"shasum":"0c90bc6a78ac41ffeaae7e57590dfc62d3888473","tarball":"https://registry.npmjs.org/babel-plugin-module-rewrite/-/babel-plugin-module-rewrite-0.0.1.tgz","integrity":"sha512-kx/7NjHJzavXqBqP3JzTJJITV41chZIhwoazopTP5A2Pe1XhWEAY8OJPGjII9yD4ZOmaKeyrYqNwouNspM4F8Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDvLnainOyfxr3BMWQbZMPy9nPc7ROC7aH++nUG1NSOeAiEAlOQ4GD5fiH/QtC/bGT5zmb3xh5SmTMJ9HmA3DKK00Wc="}]},"maintainers":[{"name":"liady","email":"liadydev@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/babel-plugin-module-rewrite-0.0.1.tgz_1466940324369_0.2898979471065104"}},"0.0.2":{"name":"babel-plugin-module-rewrite","version":"0.0.2","main":"lib/index.js","description":"Babel plugin to dynamically rewrite the path in require() and ES6 import","repository":{"type":"git","url":"git+https://github.com/liady/babel-plugin-module-rewrite.git"},"author":{"name":"Liad Yosef"},"license":"MIT","keywords":["babel","babel-plugin","module","rewrite","resolve","dynamic","rename","require","import"],"dependencies":{},"devDependencies":{"babel-cli":"^6.10.1","babel-core":"^6.8.0","babel-preset-es2015":"^6.6.0","babel-register":"^6.8.0","cross-env":"^1.0.8","mocha":"^2.5.0"},"scripts":{"compile":"cross-env NODE_ENV=production babel src --out-dir lib","test":"cross-env NODE_ENV=test npm run test:suite","test:suite":"mocha --compilers js:babel-register","test:watch":"npm run test:suite -- -w","prepublish":"npm run compile"},"gitHead":"41623a8af11f1bbe6e6b965ba72600737fa90024","bugs":{"url":"https://github.com/liady/babel-plugin-module-rewrite/issues"},"homepage":"https://github.com/liady/babel-plugin-module-rewrite#readme","_id":"babel-plugin-module-rewrite@0.0.2","_shasum":"8493b54448547a3bb5ae260fee7492aae2aab30b","_from":".","_npmVersion":"3.9.3","_nodeVersion":"6.2.1","_npmUser":{"name":"liady","email":"liadydev@gmail.com"},"dist":{"shasum":"8493b54448547a3bb5ae260fee7492aae2aab30b","tarball":"https://registry.npmjs.org/babel-plugin-module-rewrite/-/babel-plugin-module-rewrite-0.0.2.tgz","integrity":"sha512-bXzttlxiPm8s/A9NT042fW5zWdvCajDYCtaNj4ny525Nj4vlLm8/093RnBNhgMdqqw24w7i5Arxdpbnf1MZSqA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG+SxTdNbQVteZDbN81xWr39/hcu1dKZSWP7v5zQvnf0AiAcpPwmgMUa5eSfkvtzpmhd+stprHCJEOZ1vR3hjQRIdw=="}]},"maintainers":[{"name":"liady","email":"liadydev@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/babel-plugin-module-rewrite-0.0.2.tgz_1466947420506_0.6125934347510338"}},"0.1.0":{"name":"babel-plugin-module-rewrite","version":"0.1.0","main":"lib/index.js","description":"Babel plugin to dynamically rewrite the path in require() and ES6 import","repository":{"type":"git","url":"git+https://github.com/liady/babel-plugin-module-rewrite.git"},"author":{"name":"Liad Yosef"},"license":"MIT","keywords":["babel","babel-plugin","module","rewrite","resolve","dynamic","rename","require","import"],"dependencies":{},"devDependencies":{"babel-cli":"^6.10.1","babel-core":"^6.8.0","babel-preset-es2015":"^6.6.0","babel-register":"^6.8.0","cross-env":"^1.0.8","mocha":"^2.5.0"},"scripts":{"compile":"cross-env NODE_ENV=production babel src --out-dir lib","test":"cross-env NODE_ENV=test npm run test:suite","test:suite":"mocha --compilers js:babel-register","test:watch":"npm run test:suite -- -w","prepublish":"npm run compile"},"gitHead":"5e7efbd00958661a69d4ed08f9881271f24552c8","bugs":{"url":"https://github.com/liady/babel-plugin-module-rewrite/issues"},"homepage":"https://github.com/liady/babel-plugin-module-rewrite#readme","_id":"babel-plugin-module-rewrite@0.1.0","_shasum":"d43fbf2ac71a7a3ed32497fc3f290c52664a3624","_from":".","_npmVersion":"3.10.5","_nodeVersion":"5.0.0","_npmUser":{"name":"liady","email":"liadydev@gmail.com"},"dist":{"shasum":"d43fbf2ac71a7a3ed32497fc3f290c52664a3624","tarball":"https://registry.npmjs.org/babel-plugin-module-rewrite/-/babel-plugin-module-rewrite-0.1.0.tgz","integrity":"sha512-xEX8G/bF/ne1uYZApAXgB5E4EzMqLajsA4JyVCMctLp/EhO1MhD0f3ozUYOHZyZfEu/t3CRpRqvuQ8y7W0iFuQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhe5JNnNCGmSPEOGbnuMwtboXUoDYeTMYCyaGgNHQiQQIgUOTdCniPgiU0FPbjbvme0wGIdfulnQUoUPcpNveMyF8="}]},"maintainers":[{"name":"liady","email":"liadydev@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/babel-plugin-module-rewrite-0.1.0.tgz_1474498883731_0.38928837119601667"}},"0.1.1":{"name":"babel-plugin-module-rewrite","version":"0.1.1","main":"lib/index.js","description":"Babel plugin to dynamically rewrite the path in require() and ES6 import","repository":{"type":"git","url":"git+https://github.com/liady/babel-plugin-module-rewrite.git"},"author":{"name":"Liad Yosef"},"license":"MIT","keywords":["babel","babel-plugin","module","rewrite","resolve","dynamic","rename","require","import"],"dependencies":{},"devDependencies":{"babel-cli":"^6.10.1","babel-core":"^6.8.0","babel-preset-es2015":"^6.6.0","babel-register":"^6.8.0","cross-env":"^1.0.8","mocha":"^2.5.0"},"scripts":{"compile":"cross-env NODE_ENV=production babel src --out-dir lib","test":"cross-env NODE_ENV=test npm run test:suite","test:suite":"mocha --compilers js:babel-register","test:watch":"npm run test:suite -- -w","prepublish":"npm run compile"},"gitHead":"c0d3c0031436454cf6bfae549d5019e79ea96773","bugs":{"url":"https://github.com/liady/babel-plugin-module-rewrite/issues"},"homepage":"https://github.com/liady/babel-plugin-module-rewrite#readme","_id":"babel-plugin-module-rewrite@0.1.1","_shasum":"7a144654ad0d64fd00b31deef9b01e98914c2d39","_from":".","_npmVersion":"3.10.5","_nodeVersion":"5.0.0","_npmUser":{"name":"liady","email":"liadydev@gmail.com"},"dist":{"shasum":"7a144654ad0d64fd00b31deef9b01e98914c2d39","tarball":"https://registry.npmjs.org/babel-plugin-module-rewrite/-/babel-plugin-module-rewrite-0.1.1.tgz","integrity":"sha512-BaU0GiV2/ZGQq6LBviTE6qiQofPXkzc4rR4hOx+KavZ/HUmehbv+t9nCfVeyzG+AAhIIW7goqvHCOULaobkAQw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCxVL+o68gj7RKfN8jP6SJwphL6vxwaqyBA+67leo3AwQIgaMZzQJU+x9Ear3uXoAGBFhcrTQUVOacXwmWDadogm7Q="}]},"maintainers":[{"name":"liady","email":"liadydev@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/babel-plugin-module-rewrite-0.1.1.tgz_1474499210344_0.4745106194168329"}},"0.1.2":{"name":"babel-plugin-module-rewrite","version":"0.1.2","main":"lib/index.js","description":"Babel plugin to dynamically rewrite the path in require() and ES6 import","repository":{"type":"git","url":"git+https://github.com/liady/babel-plugin-module-rewrite.git"},"author":{"name":"Liad Yosef"},"license":"MIT","keywords":["babel","babel-plugin","module","rewrite","resolve","dynamic","rename","require","import"],"dependencies":{},"devDependencies":{"babel-cli":"^6.10.1","babel-core":"^6.8.0","babel-preset-es2015":"^6.6.0","babel-register":"^6.8.0","cross-env":"^1.0.8","mocha":"^2.5.0"},"scripts":{"compile":"cross-env NODE_ENV=production babel src --out-dir lib","test":"cross-env NODE_ENV=test npm run test:suite","test:suite":"mocha --compilers js:babel-register","test:watch":"npm run test:suite -- -w","prepublish":"npm run compile"},"gitHead":"7ed1317e0c61a96d3cef4cb9ee36adb61ee4a046","bugs":{"url":"https://github.com/liady/babel-plugin-module-rewrite/issues"},"homepage":"https://github.com/liady/babel-plugin-module-rewrite#readme","_id":"babel-plugin-module-rewrite@0.1.2","_shasum":"67a9832a844801ab0567cf0934f80fef99e26fa9","_from":".","_npmVersion":"3.10.5","_nodeVersion":"5.0.0","_npmUser":{"name":"liady","email":"liadydev@gmail.com"},"dist":{"shasum":"67a9832a844801ab0567cf0934f80fef99e26fa9","tarball":"https://registry.npmjs.org/babel-plugin-module-rewrite/-/babel-plugin-module-rewrite-0.1.2.tgz","integrity":"sha512-ogkPMwcMwZpCe8PMlLcBs+I3nrLUmVMygXjk1k+UoIeTS9+9170VXA7Q3kjxmpZmpTRh6thx7S38/vHDjUjvRQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCXYjfWE063H/t6cz8l94fDcmJPfX4EOAcPhig+O1pEYQIgEHdFETS0Pxj9OTF1LnmYo1EuOB1W6a1IsI7VYRgE4Bs="}]},"maintainers":[{"name":"liady","email":"liadydev@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/babel-plugin-module-rewrite-0.1.2.tgz_1474499782959_0.511912431800738"}},"0.2.0":{"name":"babel-plugin-module-rewrite","version":"0.2.0","main":"lib/index.js","description":"Babel plugin to dynamically rewrite the path in require() and ES6 import","repository":{"type":"git","url":"git+https://github.com/liady/babel-plugin-module-rewrite.git"},"author":{"name":"Liad Yosef"},"license":"MIT","keywords":["babel","babel-plugin","module","rewrite","resolve","dynamic","rename","require","import"],"dependencies":{},"devDependencies":{"babel-cli":"^6.10.1","babel-core":"^6.8.0","babel-preset-es2015":"^6.6.0","babel-register":"^6.8.0","cross-env":"^1.0.8","mocha":"^2.5.0"},"scripts":{"compile":"cross-env NODE_ENV=production babel src --out-dir lib","test":"cross-env NODE_ENV=test npm run test:suite","test:suite":"mocha --compilers js:babel-register","test:watch":"npm run test:suite -- -w","prepublish":"npm run compile"},"gitHead":"823ee3314de63c15b0cb22166a49cbce08742d2c","bugs":{"url":"https://github.com/liady/babel-plugin-module-rewrite/issues"},"homepage":"https://github.com/liady/babel-plugin-module-rewrite#readme","_id":"babel-plugin-module-rewrite@0.2.0","_shasum":"5d7e6c31e3bad6ce3a0ef723983af245b96fdc84","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.0","_npmUser":{"name":"liady","email":"liadydev@gmail.com"},"dist":{"shasum":"5d7e6c31e3bad6ce3a0ef723983af245b96fdc84","tarball":"https://registry.npmjs.org/babel-plugin-module-rewrite/-/babel-plugin-module-rewrite-0.2.0.tgz","integrity":"sha512-lLPNLk3Fn/QtCcOIU7U08hEgSk5jMyQAnfSid08M63l3S2M/rDyxVeWSv10RU8n5Xwe3EU4zvQY/Bmks4C6vfg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCyzl3jBEfNxGf5Y2Im7c8ueY8d/luRgMZqF+fIeA8QawIhAIfCDiYsRNFB4L1iZJhcuiEajE/4LhMk1uLQSFQVez9h"}]},"maintainers":[{"name":"liady","email":"liadydev@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/babel-plugin-module-rewrite-0.2.0.tgz_1496520324138_0.7610666058026254"}}},"readme":"# babel-plugin-module-rewrite\r\n[![Version](https://img.shields.io/npm/v/babel-plugin-module-rewrite.svg)](https://www.npmjs.org/package/babel-plugin-module-rewrite)\r\n[![Build Status](https://travis-ci.org/liady/babel-plugin-module-rewrite.svg?branch=master)](https://travis-ci.org/liady/babel-plugin-module-rewrite)\r\n\r\nA [babel](http://babeljs.io) plugin to rewrite module imports (and `require`) using a custom function\r\n\r\n## Description\r\n\r\nYou can supply a replace function to dynamically replace module paths when Babel traverses them.\r\n\r\n## Usage\r\n\r\nInstall the plugin\r\n\r\n```\r\n$ npm install --save-dev babel babel-plugin-module-rewrite\r\n```\r\n\r\nSpecify the plugin in your `.babelrc` with the file that exports the replace function.\r\n```json\r\n{\r\n  \"plugins\": [\r\n    [\"module-rewrite\", { \"replaceFunc\": \"./utils/replace-module-paths.js\" }]\r\n  ]\r\n}\r\n```\r\n\r\nLet's say you want `~/moduleFile` to be replaced to `utils/moduleFile` if the calling file is in `utils`, and `common/moduleFile` otherwise.\r\nSo in your `replace-module-paths.js`, just export:\r\n```js\r\nexport default function replaceImport(originalPath, callingFileName, options) {\r\n    if(callingFileName.indexOf('/utils/') !== -1) {\r\n        return originalPath.replace('~', 'utils');\r\n    } else {\r\n        return originalPath.replace('~', 'common');\r\n    }\r\n}\r\n```\r\n\r\n## License\r\n\r\nMIT\r\n","maintainers":[{"name":"liady","email":"liadydev@gmail.com"}],"time":{"modified":"2022-06-13T04:02:15.781Z","created":"2016-06-26T11:25:26.965Z","0.0.1":"2016-06-26T11:25:26.965Z","0.0.2":"2016-06-26T13:23:42.901Z","0.1.0":"2016-09-21T23:01:25.623Z","0.1.1":"2016-09-21T23:06:51.018Z","0.1.2":"2016-09-21T23:16:24.556Z","0.2.0":"2017-06-03T20:05:24.987Z"},"homepage":"https://github.com/liady/babel-plugin-module-rewrite#readme","keywords":["babel","babel-plugin","module","rewrite","resolve","dynamic","rename","require","import"],"repository":{"type":"git","url":"git+https://github.com/liady/babel-plugin-module-rewrite.git"},"author":{"name":"Liad Yosef"},"bugs":{"url":"https://github.com/liady/babel-plugin-module-rewrite/issues"},"license":"MIT","readmeFilename":"README.md","users":{"qddegtya":true}}