{"bugs":{"url":"https://github.com/shellscape/koa-webpack/issues"},"dist":{"shasum":"4e3d8840ddb96049419bf529d99998f0343d65d5","tarball":"https://registry.npmjs.org/koa-webpack/-/koa-webpack-5.1.0-beta.1.tgz","fileCount":6,"integrity":"sha512-uAfyZ1CRQgBqGmAxSdhCUZ9pbAIibJyx2Hl/tDXOqRFl/VeYyA7eXsCnGAMQWUKI/QtUYXYFdJ+LBr5VnymPLw==","signatures":[{"sig":"MEYCIQDb32kBaum7gblsN1yL4wndY1wQSbRI6VTn+vrgPgLnpQIhALBIlVdFKSJWjn3IT+HNqEJ4gXAUo6YhTDS6qZ53jDkQ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13150,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbPsazCRA9TVsSAnZWagAAVPcQAI93vByUs8wVg09iN6Wq\n6RccegihqY5LvvKvUsdgH38u/QaIDVhf9CVIUF4hBkYU9m+0g86iaqosnxJb\nr6mJl0QAYTU8IptV+/bRIs0qizIAyt7KV9XiTRDm49bbgtnShTAHC2hNXLGg\nDe933AIJ2WXwnpvCf2/0a2mAQfqARs5c8oENca+KVA659ONalUTHqXcUP+fv\nTwrVvlEBvfjfubeWsgZmhvLqXJ4+bbE87GXxp/gnFa0GqtTtJOcAfPdiEu8k\nbvoQc4uI+6Dc41+1tjcKPgDq8SQaHImCXpz5621ogH21Q4cNfBvB10tKYU9P\nmLL8sTcEu+uFMqP9ypJRQRlGVKDgln+Junr2tckPyctdAo8Sa7P9VgNfKwpt\n7ol8e+IBIV65r3BN3KDavd6gjjT4M8WJyiDKsN/k75OmZewnoD9YHp2vU/up\nYXxv1/4oGLvVyu0BUHSG+/9VDJVcCTfr31ZD4q311iTp1i62TNt6rj3jj+rO\nEm99qw2rkuRioSjlV8NpoI63QJ7fayh2UuTw0qDutf+C9gkQjv/HgbJOvGr8\nqRAB76qp/01vMCuPigBSTeXuyzRQiiKMkmNlkmHyxzrSEBb6WyzkBLad4qe4\nCIVRCHuPhZkRG87lIQdRvD9oXbpB4ie1PFoj08Yh9CWxEvwkA2XDTnzpOM7q\nFb2j\r\n=evi4\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"forceExit":true,"testEnvironment":"node"},"main":"lib/index.js","name":"koa-webpack","files":["lib/","schemas/","LICENSE","README.md"],"author":{"name":"Andrew Powell","email":"andrew@shellscape.org"},"readme":"<div align=\"center\">\n  <a href=\"https://koajs.com\">\n    <img width=\"200\" src=\"https://i.imgur.com/IABvnrD.png\"/>\n  </a>\n  <a href=\"https://github.com/webpack/webpack\">\n    <img width=\"200\" height=\"200\" src=\"https://webpack.js.org/assets/icon-square-big.svg\"/>\n  </a>\n</div>\n\n[![npm][npm]][npm-url]\n[![node][node]][node-url]\n[![deps][deps]][deps-url]\n[![tests][tests]][tests-url]\n[![chat][chat]][chat-url]\n[![size][size]][size-url]\n\n# koa-webpack\n\nDevelopment and Hot Module Reload Middleware for **Koa2**, in a single\nmiddleware module.\n\nThis module wraps and composes\n[`webpack-dev-middleware`](https://github.com/webpack/webpack-dev-middleware) and\n[`webpack-hot-client`](https://github.com/webpack-contrib/webpack-hot-client)\ninto a single middleware module, allowing for quick and concise implementation.\n\nAs an added bonus, it'll also use the installed `webpack` module from your project,\nand the `webpack.config.js` file in the root of your project, automagically, should\nyou choose to let it. This negates the need for all of the repetitive setup and\nconfig that you get with `koa-webpack-middleware`.\n\n## Requirements\n\nThis module requires a minimum of Node v6.9.0 and Webpack v4.0.0.\n\n## Getting Started\n\nTo begin, you'll need to install `koa-webpack`:\n\n```console\n$ npm install koa-webpack --save-dev\n```\n\nNext, setup the module in your code. (We're assuming ES6 syntax here)\n\n```js\nconst Koa = require('koa');\n\nconst app = new Koa();\n\nconst koaWebpack = require('koa-webpack');\n\nkoaWebpack({ .. options .. })\n .then((middleware) => {\n  app.use(middleware);\n});\n```\n\n## API\n\n### koaWebpack([options])\n\nReturns an `Object` containing:\n\n- `close(callback)` *(Function)* - Closes both the instance of `webpack-dev-middleware`\nand `webpack-hot-client`. Accepts a single `Function` callback parameter that is\nexecuted when complete.\n- `client` *(Object)* - An instance of `webpack-hot-client`.\n- `dev` *(Object)* - An instance of `webpack-dev-middleware`\n\n## Options\n\nThe middleware accepts an `options` Object, which can contain options for the\n`webpack-dev-middleware` and `webpack-hot-client` bundled with this module.\nThe following is a property reference for the Object:\n\n### compiler\n\nType: `Object`  \n`optional`\n\nShould you rather that the middleware use an instance of `webpack` that you've\nalready init'd [with webpack config], you can pass it to the middleware using\nthis option.\n\nExample:\n\n```js\nconst webpack = require('webpack');\nconst config = require('./webpack.config.js');\nconst compiler = Webpack(config);\nconst koaWebpack = require('koa-webpack');\n\nkoaWebpack({ compiler })\n .then((middleware) => {\n  app.use(middleware);\n});\n```\n\n### config\n\nType: `Object`  \n`optional`\n\nShould you rather that the middleware use an instance of webpack configuration\nthat you've already required/imported, you can pass it to the middleware using\nthis option.\n\nExample:\n\n```js\nconst config = require('./webpack.config.js');\nconst koaWebpack = require('koa-webpack');\n\nkoaWebpack({ config })\n .then((middleware) => {\n  app.use(middleware);\n});\n```\n\n### devMiddleware\n\nType: `Object`  \n`optional`\n\nThe `devMiddleware` property should contain options for `webpack-dev-middleware`, a list of\nwhich is available at [webpack-dev-middleware](https://github.com/webpack/webpack-dev-middleware).\nOmitting this property will result in `webpack-dev-middleware` using its default\noptions.\n\n### hotClient\n\nType: `Object|Boolean`  \n`optional`\n\nThe `hotClient` property should contain options for `webpack-hot-client`, a list of\nwhich is available at [webpack-hot-client](https://github.com/webpack-contrib/webpack-hot-client).\nOmitting this property will result in `webpack-hot-client` using its default\noptions.\n\nAs of `v3.0.1` setting this to `false` will completely disable `webpack-hot-client`\nand all automatic Hot Module Replacement functionality.\n\n## Using with koa-compress\n\nWhen using `koa-webpack` with [koa-compress](https://github.com/koajs/compress),\nyou may experience issues with saving files and hot module reload. Please review\n[this issue](https://github.com/shellscape/koa-webpack/issues/36#issuecomment-289565573)\nfor more information and a workaround.\n\n## Server-Side-Rendering\n\nWhen `serverSideRender` is set to true in `config.dev`, `webpackStats` is\naccessible from `ctx.state.webpackStats`.\n\n```js\napp.use(async (ctx, next) => {\n  const assetsByChunkName = ctx.state.webpackStats.toJson().assetsByChunkName;\n  // do something with assetsByChunkName\n})\n```\n\nFor more details please refer to:\n[webpack-dev-middleware](https://github.com/webpack/webpack-dev-middleware#server-side-rendering)\n\n\n## Contributing\n\nPlease take a moment to read our contributing guidelines if you haven't yet done so.\n\n#### [CONTRIBUTING](./.github/CONTRIBUTING.md)\n\n## Attribution\n\nThis module started as a fork of\n[`koa-webpack-middleware`](https://github.com/leecade/koa-webpack-middleware)\n\n## License\n\n#### [MIT](./LICENSE)\n\n[npm]: https://img.shields.io/npm/v/koa-webpack.svg\n[npm-url]: https://npmjs.com/package/koa-webpack\n\n[node]: https://img.shields.io/node/v/koa-webpack.svg\n[node-url]: https://nodejs.org\n\n[deps]: https://david-dm.org/shellscape/koa-webpack.svg\n[deps-url]: https://david-dm.org/shellscape/koa-webpack\n\n[tests]: \thttps://img.shields.io/circleci/project/github/shellscape/koa-webpack.svg\n[tests-url]: https://circleci.com/gh/shellscape/koa-webpack\n\n[cover]: https://codecov.io/gh/shellscape/koa-webpack/branch/master/graph/badge.svg\n[cover-url]: https://codecov.io/gh/shellscape/koa-webpack\n\n[chat]: https://img.shields.io/badge/gitter-webpack%2Fwebpack-brightgreen.svg\n[chat-url]: https://gitter.im/webpack/webpack\n\n[size]: https://packagephobia.now.sh/badge?p=koa-webpack\n[size-url]: https://packagephobia.now.sh/result?p=koa-webpack","engines":{"node":">= 6.9.0 < 7.0.0 || >= 8.9.0"},"gitHead":"fa98860bf46308901a9a9d7a9a58b9918d5878fd","license":"MIT","scripts":{"lint":"eslint --cache src test","test":"jest","ci:lint":"npm run lint && npm run security","ci:test":"npm run test -- --runInBand","release":"standard-version","defaults":"defaults","security":"nsp check","commitmsg":"commitlint -e $GIT_PARAMS","commitlint":"commitlint","release:ci":"conventional-github-releaser -p angular","test:watch":"jest --watch","ci:coverage":"npm run test:coverage -- --runInBand","lint-staged":"lint-staged","test:coverage":"jest --collectCoverageFrom='lib/**/*.js' --coverage","ci:lint:commits":"commitlint --from=${CIRCLE_BRANCH} --to=${CIRCLE_SHA1}","release:validate":"commitlint --from=$(git describe --tags --abbrev=0) --to=$(git rev-parse HEAD)"},"_npmUser":{"name":"shellscape","email":"andrew@shellscape.org"},"homepage":"https://github.com/shellscape/koa-webpack","keywords":["webpack"],"pre-commit":"lint-staged","repository":{"url":"git+https://github.com/shellscape/koa-webpack.git","type":"git"},"_npmVersion":"5.6.0","description":"Development and Hot Reload Middleware for Koa2","directories":{},"lint-staged":{"*.js":["eslint --fix","git add"]},"maintainers":[{"name":"shellscape","email":"andrew@shellscape.org"}],"_nodeVersion":"10.1.0","dependencies":{"webpack-log":"^1.1.1","app-root-path":"^2.0.1","merge-options":"^1.0.0","loud-rejection":"^1.6.0","webpack-hot-client":"^4.1.0-beta.1","webpack-dev-middleware":"^3.0.0","@webpack-contrib/schema-utils":"^1.0.0-beta.0"},"publishConfig":{"tag":"beta"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"del":"^3.0.0","koa":"^2.2.0","nsp":"^3.2.1","jest":"^23.1.0","husky":"^0.14.3","eslint":"^4.19.1","del-cli":"^1.1.0","webpack":"^4.10.2","killable":"^1.0.0","prettier":"^1.13.4","babel-cli":"^6.26.0","cross-env":"^5.1.6","deepmerge":"^2.0.1","memory-fs":"^0.4.1","supertest":"^3.1.0","babel-jest":"^23.0.1","pre-commit":"^1.2.2","koa-compose":"^4.0.0","lint-staged":"^7.1.3","babel-polyfill":"^6.26.0","@commitlint/cli":"^6.2.0","babel-preset-env":"^1.7.0","standard-version":"^4.4.0","eslint-plugin-import":"^2.12.0","eslint-config-webpack":"^1.2.5","eslint-plugin-prettier":"^2.6.0","@webpack-contrib/defaults":"^2.4.0","conventional-github-releaser":"^3.1.0","@commitlint/config-conventional":"^6.1.3","@webpack-contrib/eslint-config-webpack":"^2.0.4","babel-plugin-transform-object-rest-spread":"^6.26.0"},"peerDependencies":{"webpack":"^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/koa-webpack_5.1.0-beta.1_1530840755812_0.7404088227393955","host":"s3://npm-registry-packages"},"_id":"koa-webpack@5.1.0-beta.1","version":"5.1.0-beta.1"}