{"bugs":{"url":"https://github.com/webpack-contrib/karma-webpack/issues"},"dist":{"shasum":"3b0584839a4eb51dc96c77b3829430e87fe09cf0","tarball":"https://registry.npmjs.org/karma-webpack/-/karma-webpack-5.0.0-alpha.2.tgz","fileCount":7,"integrity":"sha512-Kcjw3o+FvoFaUrJarwuTQvjuUL9VtmhbvM1JzNH1QAdv4R3bEv6szcGFLe5GHznRzuEf7Z+bfo8Hufd03UEmlg==","signatures":[{"sig":"MEUCIB0LUiiXbj3LMohcu3CQ+HNKm2qSA+7DwoDUnBJZfuBUAiEAw9jHp2O1lE0nP1vx4vUbYCTXpOPwv0beTRCdS5E4iZ8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":31855,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcY3wHCRA9TVsSAnZWagAA7xYP/1s9J74ilOIYMTgSc7ew\nHccSHVJG/XYjfHOv0uMcn2SlHsXp5yfw4TSYYhpXk7ZYCmha2aAeSQ3Vw0sF\naIPtosXvFb7YfrBXmK8AEDxf6rrPk/r5l19ET+PdK8h005Er9WqywJ6anXgh\nyOfkRQCXIG04Q76taTLWnE6pwCzjgAe5936rJJLgaOWq0lwjX4UgOuLzc0/z\nsT1i5SM+yK4vHnwOQRr7OzIGFkiQimfbumYS50z5IfIba2NvwqvzrY9f5knj\nmO2nBpd3xp3cDZbac0tlrw9obfPreQ2SQvip7TTPaYCMgXb2F3OJCoOW+N9Q\nsx2FMnxgSNyGAVjHDxRPdSQqL0Eynneg0mN4vKaqeTRSssEIJfYVww+12Mte\nCBvZ2jEyeOwPetrEKCEpe9HsMkHDmb0I3lwUv7weeMuYyd83d26Eq6c7ibwK\nqAbzf1LdixzKkNH0Ij+pLNqVD1XbNUkhmztfRmWD/tJCc+r4ohxxfGlUmqbl\nopvAIjvvnwpBmEcwLR7gyYakQox/AcqlmqIsfRjZuOAn7rPovN8xY0TtxJiO\nOvz3h2/strOGZzDgfndsip2sJ1Bh8osUoajC+VQXvpmc2vVus/cP9iX8wxWP\n1QECWcHjoa0Jtk5uC0f6YW0cMusnlGbOe2Ff89gDnYX9ibDbbE/1T6HrY6ZM\nPJal\r\n=MFQb\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\n    // add webpack to your list of frameworks\n    frameworks: ['mocha', 'webpack'],\n\n    files: [\n      // all files ending in \".test.js\"\n      // !!! use watched: false as we use webpacks watch\n      { pattern: 'test/**/*.test.js', watched: false }\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      // Do NOT specify the entry option\n      // webpack watches dependencies\n\n      // webpack configuration\n    },\n  });\n}\n```\n\n### Default webpack configuration\n\nThis configuration will be merged with what gets provided via karma's config.webpack.\n\n```js\nconst defaultWebpackOptions = {\n  mode: 'development',\n  output: {\n    filename: '[name].js',\n    path: path.join(os.tmpdir(), '_karma_webpack_'),\n  },\n  stats: {\n    modules: false,\n    colors: true,\n  },\n  watch: false,\n  optimization: {\n    runtimeChunk: 'single',\n    splitChunks: {\n      chunks: 'all',\n      minSize: 0,\n      cacheGroups: {\n        commons: {\n          name: 'commons',\n          chunks: 'initial',\n          minChunks: 1,\n        },\n      },\n    },\n  },\n  plugins: [],\n  // Something like this will be auto added by this.configure()\n  // entry: {\n  //   'foo-one.test.js': 'path/to/test/foo-one.test.js',\n  //   'foo-two.test.js': 'path/to/test/foo-two.test.js',\n  // },\n  // plugins: [\n  //   new KarmaSyncPlugin()\n  // ],\n};\n```\n\n### How it works\n\nThis project is a framework and preprocessor for Karma that combines test files and dependencies into 2 shared bundles and 1 chunk per test file. It relies on webpack to generate the bundles/chunks and to keep it updated during autoWatch=true.\n\nThe first preproccessor triggers the build of all the bundles/chunks and all following files just return the output of this one build process.\n\n### Webpack typescript support\n\nBy default karma-webpack forces *.js files so if you test *.ts files and use webpack to build typescript to javascript it works out of the box.\n\nIf you have a different need you can override by settig `webpack.transformPath`\n\n```js\n// this is the by default applied transformPath\nwebpack: {\n  transformPath: (filepath) => {\n      // force *.js files by default\n      const info = path.parse(filepath);\n      return `${path.join(info.dir, info.name)}.js`;\n    },\n},\n```\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\n### `webpack`\n\n`webpack` configuration (`webpack.config.js`).\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":"2e9720ab7f96fc8ece1eaef92fbd13fa082b2f15","license":"MIT","scripts":{"lint":"eslint --cache lib test","test":"jest","ci:lint":"npm run lint && npm run security","ci:test":"npm run test -- --runInBand","release":"standard-version","defaults":"webpack-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='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":"matthieu-foucault","email":"foucault.matthieu@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.5.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":"8.11.4","dependencies":{"glob":"^7.1.3","minimatch":"^3.0.4","webpack-merge":"^4.1.5"},"_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_5.0.0-alpha.2_1550023686279_0.5590763751174372","host":"s3://npm-registry-packages"},"_id":"karma-webpack@5.0.0-alpha.2","version":"5.0.0-alpha.2"}