{"_id":"babel-plugin-transform-inline-imports-commonjs","_rev":"5-f9f6c14fe8c70c7d56f8f6286feda8c5","name":"babel-plugin-transform-inline-imports-commonjs","description":"A Babel transform that turns imports into lazily loaded commonjs requires","dist-tags":{"latest":"1.2.0"},"versions":{"1.0.0":{"name":"babel-plugin-transform-inline-imports-commonjs","version":"1.0.0","description":"A Babel transform that turns imports into lazily loaded commonjs requires","keywords":["babel-plugin","commonjs"],"license":"MIT","author":{"name":"Andres Suarez","email":"zertosh@gmail.com"},"files":["transform-inline-imports-commonjs.js"],"main":"transform-inline-imports-commonjs.js","repository":{"type":"git","url":"git+https://github.com/zertosh/babel-plugin-transform-inline-imports-commonjs.git"},"scripts":{"test":"tap test/*-test.js"},"dependencies":{"babel-plugin-transform-strict-mode":"^6.8.0"},"devDependencies":{"babel-core":"^6.17.0","babel-plugin-check-es2015-constants":"^6.8.0","babel-plugin-external-helpers":"^6.8.0","babel-plugin-transform-decorators-legacy":"^1.3.4","babel-plugin-transform-es2015-arrow-functions":"^6.8.0","babel-plugin-transform-es2015-block-scoping":"^6.15.0","babel-plugin-transform-es2015-classes":"^6.14.0","babel-plugin-transform-es2015-destructuring":"^6.16.0","babel-plugin-transform-es2015-function-name":"^6.9.0","babel-plugin-transform-es2015-parameters":"^6.17.0","babel-plugin-transform-es2015-template-literals":"^6.8.0","babel-plugin-transform-es3-member-expression-literals":"^6.8.0","babel-plugin-transform-es3-property-literals":"^6.8.0","babel-plugin-transform-runtime":"^6.15.0","babel-preset-react":"^6.16.0","glob":"^7.1.1","tap":"^7.1.2"},"gitHead":"9ef345ca16b2cba83dc74ab7aad7ed1f46aefa4e","bugs":{"url":"https://github.com/zertosh/babel-plugin-transform-inline-imports-commonjs/issues"},"homepage":"https://github.com/zertosh/babel-plugin-transform-inline-imports-commonjs#readme","_id":"babel-plugin-transform-inline-imports-commonjs@1.0.0","_shasum":"4b7351b4c021b3922d58200719e98083f7b4709f","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.7.0","_npmUser":{"name":"zertosh","email":"zertosh@gmail.com"},"dist":{"shasum":"4b7351b4c021b3922d58200719e98083f7b4709f","tarball":"https://registry.npmjs.org/babel-plugin-transform-inline-imports-commonjs/-/babel-plugin-transform-inline-imports-commonjs-1.0.0.tgz","integrity":"sha512-qbn4SaAMDX37kgfW76kmSB/0T7ya6gqqye99fzmGrKYfQy34x8+tr4VkcJKyMMIBrhtvDQhV+nBAjAZ1UvDJzg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFhRdd3WSZNo+gA98yc8LLpxG75fkb+mi31GHW1n1jUrAiEA4CJ/ZzEmInvxcQCjbPg293vAt2JcX3KMHs7+b90jsZY="}]},"maintainers":[{"name":"zertosh","email":"zertosh@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/babel-plugin-transform-inline-imports-commonjs-1.0.0.tgz_1476072318194_0.40704657370224595"}},"1.1.0":{"name":"babel-plugin-transform-inline-imports-commonjs","version":"1.1.0","description":"A Babel transform that turns imports into lazily loaded commonjs requires","keywords":["babel-plugin","commonjs"],"license":"MIT","author":{"name":"Andres Suarez","email":"zertosh@gmail.com"},"files":["transform-inline-imports-commonjs.js"],"main":"transform-inline-imports-commonjs.js","repository":{"type":"git","url":"git+https://github.com/zertosh/babel-plugin-transform-inline-imports-commonjs.git"},"scripts":{"test":"tap test/*-test.js"},"dependencies":{"babel-plugin-transform-strict-mode":"^6.8.0","builtin-modules":"^1.1.1"},"devDependencies":{"babel-core":"^6.17.0","babel-plugin-check-es2015-constants":"^6.8.0","babel-plugin-external-helpers":"^6.8.0","babel-plugin-transform-decorators-legacy":"^1.3.4","babel-plugin-transform-es2015-arrow-functions":"^6.8.0","babel-plugin-transform-es2015-block-scoping":"^6.15.0","babel-plugin-transform-es2015-classes":"^6.14.0","babel-plugin-transform-es2015-destructuring":"^6.16.0","babel-plugin-transform-es2015-function-name":"^6.9.0","babel-plugin-transform-es2015-parameters":"^6.17.0","babel-plugin-transform-es2015-template-literals":"^6.8.0","babel-plugin-transform-es3-member-expression-literals":"^6.8.0","babel-plugin-transform-es3-property-literals":"^6.8.0","babel-plugin-transform-runtime":"^6.15.0","babel-preset-react":"^6.16.0","glob":"^7.1.1","tap":"^7.1.2"},"gitHead":"7293e63edc7ccecd64dae742b7699839997ec2d3","bugs":{"url":"https://github.com/zertosh/babel-plugin-transform-inline-imports-commonjs/issues"},"homepage":"https://github.com/zertosh/babel-plugin-transform-inline-imports-commonjs#readme","_id":"babel-plugin-transform-inline-imports-commonjs@1.1.0","_shasum":"e5551ef8204d624fdcafc8e8463adaffec3649bd","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.8.1","_npmUser":{"name":"zertosh","email":"zertosh@gmail.com"},"dist":{"shasum":"e5551ef8204d624fdcafc8e8463adaffec3649bd","tarball":"https://registry.npmjs.org/babel-plugin-transform-inline-imports-commonjs/-/babel-plugin-transform-inline-imports-commonjs-1.1.0.tgz","integrity":"sha512-OJ3Um8SJ0zfb8ALpdKEJHhlkhENoVo+c6m2/J4wLqddafcrQXis001Y1Dh6CVSUo9WIriPhO++ZPUA/7VOyySg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCpOygdOxQrm6zHKnwlzIwgb11C+hvXbUMYqGj4feH0WAIgVjo8Pnz3J5CfIRer5sHMc7VSKOcCc2vcj9iruT0HeZA="}]},"maintainers":[{"name":"zertosh","email":"zertosh@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/babel-plugin-transform-inline-imports-commonjs-1.1.0.tgz_1476762432866_0.17553015262819827"}},"1.2.0":{"name":"babel-plugin-transform-inline-imports-commonjs","version":"1.2.0","description":"A Babel transform that turns imports into lazily loaded commonjs requires","keywords":["babel-plugin","commonjs"],"license":"MIT","author":{"name":"Andres Suarez","email":"zertosh@gmail.com"},"files":["transform-inline-imports-commonjs.js"],"main":"transform-inline-imports-commonjs.js","repository":{"type":"git","url":"git+https://github.com/zertosh/babel-plugin-transform-inline-imports-commonjs.git"},"scripts":{"test":"tap test/*-test.js"},"dependencies":{"babel-plugin-transform-strict-mode":"^6.8.0","builtin-modules":"^1.1.1"},"devDependencies":{"babel-core":"^6.17.0","babel-plugin-check-es2015-constants":"^6.8.0","babel-plugin-external-helpers":"^6.8.0","babel-plugin-transform-decorators-legacy":"^1.3.4","babel-plugin-transform-es2015-arrow-functions":"^6.8.0","babel-plugin-transform-es2015-block-scoping":"^6.15.0","babel-plugin-transform-es2015-classes":"^6.14.0","babel-plugin-transform-es2015-destructuring":"^6.16.0","babel-plugin-transform-es2015-function-name":"^6.9.0","babel-plugin-transform-es2015-parameters":"^6.17.0","babel-plugin-transform-es2015-template-literals":"^6.8.0","babel-plugin-transform-es3-member-expression-literals":"^6.8.0","babel-plugin-transform-es3-property-literals":"^6.8.0","babel-plugin-transform-runtime":"^6.15.0","babel-preset-react":"^6.16.0","glob":"^7.1.1","tap":"^7.1.2"},"gitHead":"f0448c4b2ea12f6d8415bde49f377d257457bc00","bugs":{"url":"https://github.com/zertosh/babel-plugin-transform-inline-imports-commonjs/issues"},"homepage":"https://github.com/zertosh/babel-plugin-transform-inline-imports-commonjs#readme","_id":"babel-plugin-transform-inline-imports-commonjs@1.2.0","_shasum":"20c7d192bafc54c8727386e3387d8ee4ef19e6a5","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.8.1","_npmUser":{"name":"zertosh","email":"zertosh@gmail.com"},"dist":{"shasum":"20c7d192bafc54c8727386e3387d8ee4ef19e6a5","tarball":"https://registry.npmjs.org/babel-plugin-transform-inline-imports-commonjs/-/babel-plugin-transform-inline-imports-commonjs-1.2.0.tgz","integrity":"sha512-0MCSUPqShJhjNX+Ao6tzXRghddVhmGjY+7xW/uxZqsckAtzteBVT1bUZPfdIxpQ+AqimWjJolmXhC8uweztFzw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC2GICKRExi0g0lVmFTYHb95+ovnPpeVqfi7J3PIbHPwQIgGnVb8A9xUZ+72jRA+eTG/NoTo4pRcWKAnrhbSqmZ44I="}]},"maintainers":[{"name":"zertosh","email":"zertosh@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/babel-plugin-transform-inline-imports-commonjs-1.2.0.tgz_1476924812071_0.08897568192332983"}}},"readme":"# babel-plugin-transform-inline-imports-commonjs\n\n**This plugin should be used instead of [`babel-plugin-transform-es2015-modules-commonjs`](http://babeljs.io/docs/plugins/transform-es2015-modules-commonjs/)**\n\n[![Build Status](https://travis-ci.org/zertosh/babel-plugin-transform-inline-imports-commonjs.svg?branch=master)](https://travis-ci.org/zertosh/babel-plugin-transform-inline-imports-commonjs)\n\n## Installation\n\n```sh\n$ npm install babel-plugin-transform-inline-imports-commonjs\n```\n\n## Details\n\nThis plugin transforms [ES modules](http://exploringjs.com/es6/ch_modules.html) ([`import`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import) and [`export`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export)), into CommonJS [`require` and `module.exports`](https://nodejs.org/api/modules.html). `import`s are transformed into lazily loaded memoized `require`s. So the `require` call is deferred until the imported identifier is referenced. This allows you to write idiomatic code without the performance costs of loading code up-front (I/O, parsing, and executing).\n\n### Transform example\n\n**Before:**\n\n```js\nimport bigModule from 'big-module';\n\nexport default function(val) {\n  return bigModule.doExpensiveThing(val);\n}\n```\n\n**After:**\n\n```js\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n\nexports.default = function (val) {\n  return (_bigModule || _bigModule2()).default.doExpensiveThing(val);\n};\n\nvar _bigModule;\n\nfunction _bigModule2() {\n  return _bigModule = _interopRequireDefault(require('big-module'));\n}\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n```\n\n## Usage\n\n### Configuration\n\nThe same settings that are available for [`babel-plugin-transform-es2015-modules-commonjs`](http://babeljs.io/docs/plugins/transform-es2015-modules-commonjs/) are available for `babel-plugin-transform-inline-imports-commonjs`:\n\n```js\n// without options\n{\n  \"plugins\": [\"transform-inline-imports-commonjs\"]\n}\n\n// with options\n{\n  \"plugins\": [\n    [\"transform-inline-imports-commonjs\", {\n      \"allowTopLevelThis\": true,\n      \"strict\": false,\n      \"loose\": true\n    }]\n  ]\n}\n```\n\n#### Additional settings\n\n* `excludeModules`:\n  - An array of strings that correspond to module IDs that should not be \"inline-import\"'ed. For the config `\"excludeModules\": [\"atom\"]`:\n\n  ```js\n  import {TextEditor} from 'atom'; // transforms to plain `require` with interop\n  import foo from 'bar'; // transforms to inline import\n  ```\n\n* `excludeNodeBuiltins` (default: `false`)\n  - Do not apply \"inline-imports\" to [Node builtin modules](https://github.com/sindresorhus/builtin-modules/blob/v1.1.1/builtin-modules.json). These modules are usually already in the module cache, so there may be no need to lazily load them.\n\n  ```js\n  import * as path from 'path'; // transforms to plain `require` with interop\n  import foo from 'bar'; // transforms to inline import\n  ```\n","maintainers":[{"name":"zertosh","email":"zertosh@gmail.com"}],"time":{"modified":"2022-06-13T04:04:43.040Z","created":"2016-10-10T04:05:20.048Z","1.0.0":"2016-10-10T04:05:20.048Z","1.1.0":"2016-10-18T03:47:14.885Z","1.2.0":"2016-10-20T00:53:32.670Z"},"homepage":"https://github.com/zertosh/babel-plugin-transform-inline-imports-commonjs#readme","keywords":["babel-plugin","commonjs"],"repository":{"type":"git","url":"git+https://github.com/zertosh/babel-plugin-transform-inline-imports-commonjs.git"},"author":{"name":"Andres Suarez","email":"zertosh@gmail.com"},"bugs":{"url":"https://github.com/zertosh/babel-plugin-transform-inline-imports-commonjs/issues"},"license":"MIT","readmeFilename":"README.md"}