{"bugs":{"url":"https://github.com/webpack-contrib/karma-webpack/issues"},"dist":{"shasum":"4c194e94789842af7f0ffa0de77ee7715739c7c1","tarball":"https://registry.npmjs.org/karma-webpack/-/karma-webpack-4.0.0-rc.2.tgz","fileCount":7,"integrity":"sha512-Wuiq/xFBsbJMsHhYy5SYXxSp7Q0b8uzAG8+Siuo56ntoi5GluPE5LK3Mzl2UtD4k1leFwL6IeIE6Q+tk4F6k9Q==","signatures":[{"sig":"MEUCIQDISdY4uCuT+pMoPrxwEdlC4iBCWPnQdGIAQ8+gHWWxvAIgO8htKE+OzQWE2zZOcBuJoPrYJ27S1cxhexj76/izW6I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":32929,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbkpa/CRA9TVsSAnZWagAAa7QP/iLaRuvkJ0zogfa24gsf\nPe+v7crVOmAe8oZpYVFx32H+mkXePeKQZHaD8jqnySLtqIKFHfKq+95DHB1p\npQInGmAs/EnYzQRgxtB1tr1MQ+ilEQ9pQf4fSEDvtg4uYA3of7DAXEKSA9Al\nolaufDkk3qxpH942axDPTuFt5B8xPJ3ZYKjzZJf90j/ssjZQqqIcQnJO9xIH\nu9kRAzuDs4DgdTvzVgEMAh+ywlrpUgtfWu9QLEKyGPYRzNblffKaWCqrapBQ\nhxi4I2xjcGFwI2/LGor3syXODC10lDzA9s/1WpTfU0KXJJzVK+o4BW4vP5dU\nZaaqWwh0LrLpb8Gbm3UBQ146epq4R603RCgQhJ5mfZmKT0YRJQR6dSTHgUc3\nSZ3igVSSUMTJ/ky/wR27oe/z5x/zUnQkXLjkm1FzPT1XhCXMDEfZdBz9XWD4\n728YOmMfmKqcxjO/0qK9Cgz+QGp4jCh/3m5dgTTDf8H3y1o5upipuOnh2lHO\nfMCmjU6gKuuOfgC4i0DKswtYQslo+qqZOrqnkNHJO4ZStMv0ZzPV4EENJLqd\nH+iGkQKArEMsJUgCHUttk6vJ2Q+fWsXpJMxJ5jrCxly7u77qUgJ2Dcav+hCe\nZlMddhaecmboprQcEVnCplL4DrymHihYA4zJ8CDORbqrR00eERYInNDmQTV2\nM7ww\r\n=qLBH\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node"},"main":"lib","name":"karma-webpack","author":{"name":"Tobias Koppers @sokra"},"readme":"[![npm][npm]][npm-url]\n[![node][node]][node-url]\n[![deps][deps]][deps-url]\n[![test][test]][test-url]\n[![coverage][cover]][cover-url]\n[![chat][chat]][chat-url]\n\n<div align=\"center\">\n  <a href='https://github.com/karma-runner/karma'>\n    <img width=\"180\" height=\"180\"\n      src=\"https://worldvectorlogo.com/logos/karma.svg\">\n  </a>\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>Karma Webpack</h1>\n  <p>Use webpack to preprocess files in karma<p>\n</div>\n\n<h2 align=\"center\">Install</h2>\n\n```bash\nnpm i -D karma-webpack\n```\n\n<h2 align=\"center\">Usage</h2>\n\n**karma.conf.js**\n```js\nmodule.exports = (config) => {\n  config.set({\n    // ... normal karma configuration\n    files: [\n      // all files ending in \"_test\"\n      { pattern: 'test/*_test.js', watched: false },\n      { pattern: 'test/**/*_test.js', watched: false }\n      // each file acts as entry point for the webpack configuration\n    ],\n\n    preprocessors: {\n      // add webpack as preprocessor\n      'test/*_test.js': [ 'webpack' ],\n      'test/**/*_test.js': [ 'webpack' ]\n    },\n\n    webpack: {\n      // karma watches the test entry points\n      // (you don't need to specify the entry option)\n      // webpack watches dependencies\n\n      // webpack configuration\n    },\n\n    webpackMiddleware: {\n      // webpack-dev-middleware configuration\n      // i. e.\n      stats: 'errors-only'\n    }\n  })\n}\n```\n\n### `Alternative Usage`\n\nThis configuration is more performant, but you cannot run single test anymore (only the complete suite).\n\nThe above configuration generates a `webpack` bundle for each test. For many test cases this can result in many big files. The alternative configuration creates a single bundle with all test cases.\n\n**karma.conf.js**\n```js\nfiles: [\n  // only specify one entry point\n  // and require all tests in there\n  'test/index_test.js'\n],\n\npreprocessors: {\n  // add webpack as preprocessor\n  'test/index_test.js': [ 'webpack' ]\n},\n```\n\n**test/index_test.js**\n```js\n// require all modules ending in \"_test\" from the\n// current directory and all subdirectories\nconst testsContext = require.context(\".\", true, /_test$/)\n\ntestsContext.keys().forEach(testsContext)\n```\n\nEvery test file is required using the [require.context](https://webpack.js.org/guides/dependency-management/#require-context) and compiled with webpack into one test bundle.\n\n### `Source Maps`\n\nYou can use the `karma-sourcemap-loader` to get the source maps generated for your test bundle.\n\n```bash\nnpm i -D karma-sourcemap-loader\n```\n\nAnd then add it to your preprocessors.\n\n**karma.conf.js**\n```js\npreprocessors: {\n  'test/test_index.js': [ 'webpack', 'sourcemap' ]\n}\n```\n\nAnd tell `webpack` to generate sourcemaps.\n\n**webpack.config.js**\n```js\nwebpack: {\n  // ...\n  devtool: 'inline-source-map'\n}\n```\n\n<h2 align=\"center\">Options</h2>\n\nThis is the full list of options you can specify in your `karma.conf.js`\n\n|Name|Type|Default|Description|\n|:--:|:--:|:-----:|:----------|\n|[**`webpack`**](#webpack)|`{Object}`|`{}`|Pass `webpack.config.js` to `karma`|\n|[**`webpackMiddleware`**](#webpackmiddleware)|`{Object}`|`{}`|Pass `webpack-dev-middleware` configuration to `karma`|\n|[**`beforeMiddleware`**](#beforemiddleware)|`{Object}`|`{}`|Pass custom middleware configuration to `karma`, **before** any `karma` middleware runs|\n\n### `webpack`\n\n`webpack` configuration (`webpack.config.js`).\n\n### `webpackMiddleware`\n\nConfiguration for `webpack-dev-middleware`.\n\n### `beforeMiddleware`\n\n`beforeMiddleware` is a `webpack` option that allows injecting middleware before\nkarma's own middleware runs. This loader provides a `webpackBlocker`\nmiddleware that will block tests from running until code recompiles. That is,\ngiven this scenario\n\n1. Have a browser open on the karma debug page (http://localhost:9876/debug.html)\n2. Make a code change\n3. Refresh\n\nWithout the `webpackBlocker` middleware karma will serve files from before\nthe code change. With the `webpackBlocker` middleware the loader will not serve\nthe files until the code has finished recompiling.\n\n> **⚠️ The `beforeMiddleware` option is only supported in `karma >= v1.0.0`**\n\n<h2 align=\"center\">Maintainers</h2>\n\n<table>\n  <tbody>\n    <tr>\n      <td align=\"center\">\n        <img width=\"150\" height=\"150\"\n        src=\"https://avatars.githubusercontent.com/u/4650931?v=3&s=150\">\n        </br>\n        <a href=\"https://github.com/MikaAK\">Mika Kalathil</a>\n      </td>\n      <td align=\"center\">\n        <img width=\"150\" height=\"150\"\n        src=\"https://avatars.githubusercontent.com/u/8420490?v=3&s=150\">\n        <a href=\"https://github.com/d3viant0ne\">Joshua Wiens</a>\n      </td>\n      <td align=\"center\">\n        <img width=\"150\" height=\"150\" src=\"https://avatars.githubusercontent.com/u/1919664?v=3&s=150\">\n        <a href=\"https://github.com/goldhand\">Will Farley</a>\n      </td>\n      <td align=\"center\">\n        <img width=\"150\" height=\"150\"\n        src=\"https://avatars.githubusercontent.com/u/1307954?v=3&s=150\">\n        <a href=\"https://github.com/DanielaValero\">Daniela Valero</a>\n      </td>\n    </tr>\n    <tr>\n      <td align=\"center\">\n        <img width=\"150\" height=\"150\"\n        src=\"https://avatars.githubusercontent.com/u/122108?v=3&s=150\">\n        <a href=\"https://github.com/jon301\">Jonathan Trang</a>\n      </td>\n      <td align=\"center\">\n        <img width=\"150\" height=\"150\"\n        src=\"https://avatars.githubusercontent.com/u/3285723?v=3&s=150\">\n        <a href=\"https://github.com/carlos-\">Carlos Morales</a>\n      </td>\n    </tr>\n  <tbody>\n</table>\n\n\n[npm]: https://img.shields.io/npm/v/karma-webpack.svg\n[npm-url]: https://npmjs.com/package/karma-webpack\n\n[node]: https://img.shields.io/node/v/karma-webpack.svg\n[node-url]: https://nodejs.org\n\n[deps]: https://david-dm.org/webpack-contrib/karma-webpack.svg\n[deps-url]: https://david-dm.org/webpack-contrib/karma-webpack\n\n[chat]: https://img.shields.io/badge/gitter-webpack%2Fwebpack-brightgreen.svg\n[chat-url]: https://gitter.im/webpack/webpack\n\n[test]: http://img.shields.io/travis/webpack-contrib/karma-webpack.svg\n[test-url]: https://travis-ci.org/webpack-contrib/karma-webpack\n\n[cover]: https://codecov.io/gh/webpack-contrib/karma-webpack/branch/master/graph/badge.svg\n[cover-url]: https://codecov.io/gh/webpack-contrib/karma-webpack\n","engines":{"node":">= 6"},"gitHead":"d42c5418d93508c94d40031c42ca7107dd6f1a73","license":"MIT","scripts":{"lint":"eslint --cache src test","test":"jest","build":"cross-env NODE_ENV=production babel src -d lib --ignore 'src/**/*.test.js' --copy-files","clean":"del-cli lib","start":"npm run build -- -w","ci:lint":"npm run lint && npm run security","ci:test":"npm run test -- --runInBand","release":"standard-version","defaults":"webpack-defaults","prebuild":"npm run clean","security":"nsp check","commitmsg":"commitlint -e $GIT_PARAMS","commitlint":"commitlint","prepublish":"npm run build","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='src/**/*.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":"michael-ciniawsky","email":"michael.ciniawsky@gmail.com"},"homepage":"https://github.com/webpack-contrib/karma-webpack","keywords":["webpack"],"pre-commit":"lint-staged","repository":{"url":"git+https://github.com/webpack-contrib/karma-webpack.git","type":"git"},"_npmVersion":"6.4.0","description":"Use webpack with karma","directories":{},"lint-staged":{"*.js":["eslint --fix","git add"]},"maintainers":[{"name":"bebraw","email":"bebraw@gmail.com"},{"name":"d3viant0ne","email":"wiens.joshua@gmail.com"},{"name":"ericclemmons","email":"eric@smarterspam.com"},{"name":"evilebottnawi","email":"sheo13666q@gmail.com"},{"name":"jhnns","email":"mail@johannesewald.de"},{"name":"jtangelder","email":"j.tangelder@gmail.com"},{"name":"michael-ciniawsky","email":"michael.ciniawsky@gmail.com"},{"name":"shellscape","email":"andrew@shellscape.org"},{"name":"sokra","email":"tobias.koppers@googlemail.com"},{"name":"thelarkinn","email":"sean.larkin@cuw.edu"}],"_nodeVersion":"10.9.0","dependencies":{"async":"^2.0.0","lodash":"^4.17.10","source-map":"^0.5.6","loader-utils":"^1.1.0","webpack-dev-middleware":"^3.2.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"del":"^3.0.0","nsp":"^3.2.1","chai":"^4.1.2","jest":"^23.5.0","husky":"^0.14.3","karma":"^3.0.0","mocha":"^5.2.0","eslint":"^5.4.0","del-cli":"^1.1.0","webpack":"^4.17.2","istanbul":"^0.4.5","prettier":"^1.14.2","babel-cli":"^6.26.0","cross-env":"^5.2.0","memory-fs":"^0.4.1","babel-jest":"^23.4.2","pre-commit":"^1.2.2","karma-mocha":"^1.3.0","lint-staged":"^7.2.2","babel-polyfill":"^6.26.0","@commitlint/cli":"^7.1.1","babel-preset-env":"^1.7.0","chai-as-promised":"^7.1.1","standard-version":"^4.4.0","karma-spec-reporter":"^0.0.32","eslint-plugin-import":"^2.14.0","karma-chrome-launcher":"^2.2.0","eslint-plugin-prettier":"^2.6.2","@webpack-contrib/defaults":"^2.5.0","conventional-github-releaser":"^3.1.2","@commitlint/config-conventional":"^7.1.1","@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/karma-webpack_4.0.0-rc.2_1536333502443_0.02039589676638065","host":"s3://npm-registry-packages"},"_id":"karma-webpack@4.0.0-rc.2","version":"4.0.0-rc.2"}