{"_id":"babel-plugin-require-context-hook","_rev":"320862","name":"babel-plugin-require-context-hook","description":"Babel plugin to replicate Webpack require.context","dist-tags":{"latest":"1.0.0"},"maintainers":[{"name":"smrq","email":"smr.kyu@gmail.com"}],"time":{"modified":"2021-06-04T01:23:08.000Z","created":"2018-06-06T17:49:14.786Z","1.0.0":"2018-06-06T17:49:14.786Z"},"users":{},"author":{"name":"Greg Smith","email":"smr.kyu@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/smrq/babel-plugin-require-context-hook.git"},"versions":{"1.0.0":{"name":"babel-plugin-require-context-hook","version":"1.0.0","description":"Babel plugin to replicate Webpack require.context","main":"index.js","scripts":{"test":"node test/run.js"},"keywords":["babel","webpack"],"author":{"name":"Greg Smith","email":"smr.kyu@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/smrq/babel-plugin-require-context-hook.git"},"bugs":{"url":"https://github.com/smrq/babel-plugin-require-context-hook/issues"},"license":"MIT","devDependencies":{"babel-core":"^6.26.3","babel-register":"^6.26.0"},"gitHead":"955fb22c63f5518196328b4d87ce14176119dc30","homepage":"https://github.com/smrq/babel-plugin-require-context-hook#readme","_id":"babel-plugin-require-context-hook@1.0.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"smrq","email":"smr.kyu@gmail.com"},"dist":{"shasum":"3f0e7cce87c338f53639b948632fd4e73834632d","size":1751,"noattachment":false,"key":"/babel-plugin-require-context-hook/-/babel-plugin-require-context-hook-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/babel-plugin-require-context-hook/download/babel-plugin-require-context-hook-1.0.0.tgz"},"maintainers":[{"name":"smrq","email":"smr.kyu@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/babel-plugin-require-context-hook_1.0.0_1528307354697_0.7152042650665"},"_hasShrinkwrap":false,"publish_time":1528307354786,"_cnpm_publish_time":1528307354786}},"readme":"# babel-plugin-require-context-hook\n\n## Usage\n\nbabelrc:\n\n```\n\"plugins\": [\n\t\"require-context-hook\"\n]\n```\n\nWherever you configure babel-register (your source file, a register script, etc):\n\n```\nrequire('babel-plugin-require-context-hook/register')();\n```\n\n## How it works\n\nThe register script `babel-plugin-require-context-hook/register` implements the function `require.context` with an extra parameter-- the directory in which the calling file resides-- and places that function on the global scope.\n\nThe Babel plugin `babel-plugin-require-context-hook` rewrites all calls to `require.context` into calls to this global function, passing in `__dirname` as the extra parameter.\n","_attachments":{},"homepage":"https://github.com/smrq/babel-plugin-require-context-hook#readme","bugs":{"url":"https://github.com/smrq/babel-plugin-require-context-hook/issues"},"license":"MIT"}