{"name":"karma-webpack","version":"2.0.3","author":{"name":"Tobias Koppers @sokra"},"description":"Use webpack with karma","license":"MIT","homepage":"http://github.com/webpack/karma-webpack","scripts":{"gulp":"gulp","lint":"gulp lint","clean":"gulp clean","pretest":"npm run lint","test":"npm run test.unit","test.unit":"mocha --compilers js:babel-register --full-trace --check-leaks test/unit","test.integration":"npm run build && karma start --single-run","travis":"npm run test.unit && npm run test.integration","travis:test":"npm run test.unit","travis:lint":"npm run lint","release":"standard-version","release:tag:v2":"git push --follow-tags origin v2","release:publish":"npm run build:release && npm publish --access public","build:watch":"gulp build.watch","build:release":"gulp","build":"gulp build"},"files":["lib","index.js"],"repository":{"type":"git","url":"git+https://github.com/webpack/karma-webpack.git"},"peerDependencies":{"webpack":"^1.1.0 || ^2 || ^2.1.0-beta.0 || ^2.2.0-rc.0"},"dependencies":{"async":"~0.9.0","loader-utils":"^0.2.5","lodash":"^3.8.0","source-map":"^0.1.41","webpack-dev-middleware":"^1.0.11"},"devDependencies":{"babel-cli":"^6.11.4","babel-core":"^6.11.4","babel-plugin-transform-runtime":"^6.12.0","babel-polyfill":"^6.9.1","babel-preset-es2015":"^6.9.0","babel-preset-stage-2":"^6.11.0","babel-register":"^6.11.6","chai":"^3.5.0","chai-as-promised":"^5.3.0","del":"^2.2.1","eslint":"^3.1.1","eslint-plugin-babel":"^3.3.0","gulp":"github:gulpjs/gulp#4.0","gulp-babel":"^6.1.2","gulp-eslint":"^3.0.1","gulp-util":"^3.0.7","gulp-watch":"^4.3.9","istanbul":"^0.4.4","karma":"^1.x","karma-chrome-launcher":"~1.0.1","karma-mocha":"~1.1.1","karma-spec-reporter":"~0.0.22","mocha":"^2.5.3","standard-version":"^4.0.0"},"gitHead":"4701b62d9e99caeb8497144743f9ec010538cf77","bugs":{"url":"https://github.com/webpack/karma-webpack/issues"},"_id":"karma-webpack@2.0.3","_shasum":"39cebf5ca2580139b27f9ae69b78816b9c82fae6","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.9.5","_npmUser":{"name":"d3viant0ne","email":"wiens.joshua@gmail.com"},"dist":{"shasum":"39cebf5ca2580139b27f9ae69b78816b9c82fae6","tarball":"http://registry-npm.ywwl.com/karma-webpack/download/karma-webpack-2.0.3.tgz","integrity":"sha512-svJR+n2fqYXD/myt9xEYcEEwQdA7GukoDBiZr68tvF6akZxoU0aS+JdyXIkB3h/X/3R7zrk08G4pYqtaEoo3Cg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCFHnD1A8mIunchpcmgwKRjj2l0Ew2bA+dmU9MSQ7weQQIhAMk5SKKjpNvIhHOsNZyxQ6HjkJfmgbU5t7+qlUtsOUIG"}],"size":17875,"noattachment":false,"key":"/karma-webpack/-/karma-webpack-2.0.3.tgz"},"maintainers":[{"name":"bebraw","email":"bebraw@gmail.com"},{"name":"d3viant0ne","email":"wiens.joshua@gmail.com"},{"name":"ericclemmons","email":"eric@smarterspam.com"},{"name":"jhnns","email":"mail@johannesewald.de"},{"name":"sokra","email":"tobias.koppers@googlemail.com"},{"name":"thelarkinn","email":"sean.larkin@cuw.edu"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/karma-webpack-2.0.3.tgz_1489555426913_0.9910861097741872"},"directories":{},"readme":"[![npm][npm]][npm-url]\n[![node][node]][node-url]\n[![coverage][cover]][cover-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\nnpm `npm i -D karma-webpack`\n\nyarn `yarn add -D karma-webpack`\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    // make sure to include webpack as a framework\n    frameworks: ['mocha', 'webpack'],\n    \n    plugins: [\n      'karma-webpack',\n      'karma-mocha',\n    ],\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    },\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_') + Math.floor(Math.random() * 1000000),\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};\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\">Current Maintainers</h2>\n\n<table>\n  <tbody>\n    <tr>\n      <td>\n        <img width=\"150\" height=\"150\"\n             src=\"https://avatars.githubusercontent.com/u/13606342?s=460&u=467cf9a106d2bb474cf627ffd4e0eac80d0b4705&v=4\">\n        <br>\n        <a href=\"http://codymikol.com\">Cody Mikol</a>\n      </td>\n    </tr>\n  <tbody>\n</table>\n\n<h2 align=\"center\">Previous Maintainers</h2>\n\nPrevious maintainers of the `karma-webpack` plugin that have done such amazing work to get it to where it is today.\n\n<table class=\"maintainers\">\n  <tbody>\n    <tr>\n      <td align=\"center\">\n        <img width=\"150\" height=\"150\"\n        src=\"https://avatars0.githubusercontent.com/u/7922109?v=4&s=150\">\n        <br>\n        <a href=\"https://github.com/ryanclark\">Ryan Clark</a>\n      </td>\n      <td align=\"center\">\n        <img width=\"150\" height=\"150\"\n        src=\"https://avatars3.githubusercontent.com/u/2045543?v=4&s=150\">\n        <br>\n        <a href=\"https://github.com/AprilArcus\">April Arcus</a>\n      </td>\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[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","publish_time":1489555427581,"_cnpm_publish_time":1489555427581,"dist-tags":{"dev":"5.0.0-alpha.3.0","latest":"5.0.1","next":"5.0.0-alpha.6"}}