{"name":"bundle-loader","version":"0.5.1","author":{"name":"Tobias Koppers @sokra"},"description":"bundle loader module for webpack","dependencies":{"loader-utils":"0.2.x"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/mit-license.php"}],"repository":{"type":"git","url":"git://github.com/webpack/bundle-loader.git"},"gitHead":"68e398ecc99dfa94abcd4fe032967263a229c278","bugs":{"url":"https://github.com/webpack/bundle-loader/issues"},"homepage":"https://github.com/webpack/bundle-loader","_id":"bundle-loader@0.5.1","scripts":{},"_shasum":"1459481391fe83eb22e770cb7635fef61fe498ce","_from":".","_npmVersion":"1.4.23","_npmUser":{"name":"sokra","email":"tobias.koppers@googlemail.com"},"maintainers":[{"name":"sokra","email":"tobias.koppers@googlemail.com"}],"dist":{"shasum":"1459481391fe83eb22e770cb7635fef61fe498ce","tarball":"http://registry-npm.ywwl.com/bundle-loader/download/bundle-loader-0.5.1.tgz","integrity":"sha512-JRW+5on+MuXsKuNUV1IyQjDmjPHS09H0NKyUI8OgjeW86MHH0suPUhjn7a2Z2ui4LJLwmp4GiDc2IX1lfrjSsg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDrd+c0EmfjYHEptJHv5a4t1FXBNQu9QP44XEbiYn8VWAiEAgIWVq2PlKcJ/LqINVZC0sPl+ZHdf8xdifUddTMtzf/U="}],"size":1229,"noattachment":false,"key":"/bundle-loader/-/bundle-loader-0.5.1.tgz"},"directories":{},"readme":"[![npm][npm]][npm-url]\n[![node][node]][node-url]\n[![deps][deps]][deps-url]\n[![tests][tests]][tests-url]\n[![coverage][cover]][cover-url]\n[![chat][chat]][chat-url]\n\n<div align=\"center\">\n  <a href=\"https://github.com/webpack/webpack\">\n    <img width=\"200\" height=\"200\"\n      src=\"https://cdn.rawgit.com/webpack/media/e7485eb2/logo/icon.svg\">\n  </a>\n  <h1>Bundle Loader</h1>\n  <p>Bundle loader for webpack<p>\n</div>\n\n<h2 align=\"center\">Install</h2>\n\n```bash\nnpm i bundle-loader --save\n```\n\n<h2 align=\"center\"><a href=\"https://webpack.js.org/concepts/loaders\">Usage</a></h2>\n\n**webpack.config.js**\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.bundle\\.js$/,\n        use: 'bundle-loader'\n      }\n    ]\n  }\n}\n```\n\nThe chunk is requested, when you require the bundle.\n\n**file.js**\n```js\nimport bundle from './file.bundle.js';\n```\n\nTo wait until the chunk is available (and get the exports)\nyou need to async wait for it.\n\n```js\nbundle((file) => {\n  // use the file like it was required\n  const file = require('./file.js')\n});\n```\n\nThis wraps the `require('file.js')` in a `require.ensure` block\n\nMultiple callbacks can be added. They will be executed in the order of addition.\n\n```js\nbundle(callbackTwo)\nbundle(callbackThree)\n```\n\nIf a callback is added after dependencies were loaded, it will be called immediately.\n\n<h2 align=\"center\">Options</h2>\n\n|Name|Type|Default|Description|\n|:--:|:--:|:-----:|:----------|\n|**`lazy`**|`{Boolean}`|`false`|Loads the imported bundle asynchronously|\n|**`name`**|`{String}`|`[id].[name]`|Configure a custom filename for your imported bundle|\n\n### `lazy`\n\nThe file is requested when you require the `bundle-loader`. If you want it to request it lazy, use:\n\n**webpack.config.js**\n```js\n{\n  loader: 'bundle-loader',\n  options: {\n    lazy: true\n  }\n}\n```\n\n```js\nimport bundle from './file.bundle.js'\n\nbundle((file) => {...})\n```\n\n> ℹ️  The chunk is not requested until you call the load function\n\n### `name`\n\nYou may set name for a bundle using the `name` options parameter.\nSee [documentation](https://github.com/webpack/loader-utils#interpolatename).\n\n**webpack.config.js**\n```js\n{\n  loader: 'bundle-loader',\n  options: {\n    name: '[name]'\n  }\n}\n```\n\n> :warning: chunks created by the loader will be named according to the\n[`output.chunkFilename`](https://webpack.js.org/configuration/output/#output-chunkfilename) rule, which defaults to `[id].[name]`. Here `[name]` corresponds to the chunk name set in the `name` options parameter.\n\n<h2 align=\"center\">Examples</h2>\n\n```js\nimport bundle from './file.bundle.js'\n```\n\n**webpack.config.js**\n``` js\nmodule.exports = {\n  entry: {\n   index: './App.js'\n  },\n  output: {\n    path: path.resolve(__dirname, 'dest'),\n    filename: '[name].js',\n    // or whatever other format you want\n    chunkFilename: '[name].[id].js',\n  },\n  module: {\n    rules: [\n      {\n        test: /\\.bundle\\.js$/,\n        use: {\n          loader: 'bundle-loader',\n          options: {\n            name: 'my-chunk'\n          }\n        }\n      }\n    ]\n  }\n}\n```\n\nNormal chunks will show up using the `filename` rule above, and be named according to their `[chunkname]`.\n\nChunks from `bundle-loader`, however will load using the `chunkFilename` rule, so the example files will produce `my-chunk.1.js` and `file-2.js` respectively.\n\nYou can also use `chunkFilename` to add hash values to the filename, since putting `[hash]` in the bundle options parameter does not work correctly.\n\n<h2 align=\"center\">Maintainers</h2>\n\n<table>\n  <tbody>\n    <tr>\n      <td align=\"center\">\n        <a href=\"https://github.com/bebraw\">\n          <img width=\"150\" height=\"150\" src=\"https://github.com/bebraw.png?v=3&s=150\">\n          </br>\n          Juho Vepsäläinen\n        </a>\n      </td>\n      <td align=\"center\">\n        <a href=\"https://github.com/d3viant0ne\">\n          <img width=\"150\" height=\"150\" src=\"https://github.com/d3viant0ne.png?v=3&s=150\">\n          </br>\n          Joshua Wiens\n        </a>\n      </td>\n      <td align=\"center\">\n        <a href=\"https://github.com/michael-ciniawsky\">\n          <img width=\"150\" height=\"150\" src=\"https://github.com/michael-ciniawsky.png?v=3&s=150\">\n          </br>\n          Michael Ciniawsky\n        </a>\n      </td>\n      <td align=\"center\">\n        <a href=\"https://github.com/evilebottnawi\">\n          <img width=\"150\" height=\"150\" src=\"https://github.com/evilebottnawi.png?v=3&s=150\">\n          </br>\n          Alexander Krasnoyarov\n        </a>\n      </td>\n    </tr>\n  <tbody>\n</table>\n\n\n[npm]: https://img.shields.io/npm/v/bundle-loader.svg\n[npm-url]: https://npmjs.com/package/bundle-loader\n\n[node]: https://img.shields.io/node/v/bundle-loader.svg\n[node-url]: https://nodejs.org\n\n[deps]: https://david-dm.org/webpack-contrib/bundle-loader.svg\n[deps-url]: https://david-dm.org/webpack-contrib/bundle-loader\n\n[tests]: http://img.shields.io/travis/webpack-contrib/bundle-loader.svg\n[tests-url]: https://travis-ci.org/webpack-contrib/bundle-loader\n\n[cover]: https://coveralls.io/repos/github/webpack-contrib/bundle-loader/badge.svg\n[cover-url]: https://coveralls.io/github/webpack-contrib/bundle-loader\n\n[chat]: https://badges.gitter.im/webpack/webpack.svg\n[chat-url]: https://gitter.im/webpack/webpack\n","publish_time":1412692468104,"_cnpm_publish_time":1412692468104,"dist-tags":{"latest":"0.5.6"}}