{"name":"karma-webpack","version":"5.0.0","description":"Use webpack with karma","license":"MIT","repository":{"type":"git","url":"git+https://github.com/webpack-contrib/karma-webpack.git"},"author":{"name":"Tobias Koppers @sokra"},"homepage":"https://github.com/webpack-contrib/karma-webpack","bugs":{"url":"https://github.com/webpack-contrib/karma-webpack/issues"},"main":"lib","engines":{"node":">= 6"},"scripts":{"commitlint":"commitlint","commitmsg":"commitlint -e $GIT_PARAMS","lint":"eslint --cache lib test","ci:lint:commits":"commitlint --from=${CIRCLE_BRANCH} --to=${CIRCLE_SHA1}","lint-staged":"lint-staged","release":"standard-version","release:ci":"conventional-github-releaser -p angular","release:validate":"commitlint --from=$(git describe --tags --abbrev=0) --to=$(git rev-parse HEAD)","security":"nsp check","test":"jest","test:watch":"jest --watch","test:coverage":"jest --collectCoverageFrom='src/**/*.js' --coverage","ci:lint":"npm run lint && npm run security","ci:test":"npm run test -- --runInBand","ci:coverage":"npm run test:coverage -- --runInBand","defaults":"webpack-defaults"},"peerDependencies":{"webpack":"^5.0.0"},"dependencies":{"glob":"^7.1.3","minimatch":"^3.0.4","webpack-merge":"^4.1.5"},"devDependencies":{"@commitlint/cli":"^7.1.1","@commitlint/config-conventional":"^7.1.1","@webpack-contrib/defaults":"^2.5.0","@webpack-contrib/eslint-config-webpack":"^3.0.0","babel-cli":"^6.26.0","babel-jest":"^23.4.2","babel-plugin-transform-object-rest-spread":"^6.26.0","babel-polyfill":"^6.26.0","babel-preset-env":"^1.7.0","chai":"^4.1.2","chai-as-promised":"^7.1.1","conventional-github-releaser":"^3.1.2","cross-env":"^5.2.0","del":"^3.0.0","del-cli":"^1.1.0","eslint":"^5.4.0","eslint-plugin-import":"^2.14.0","eslint-plugin-prettier":"^2.6.2","husky":"^0.14.3","istanbul":"^0.4.5","jest":"^23.5.0","karma":"^6.0.3","karma-chai":"^0.1.0","karma-chrome-launcher":"^2.2.0","karma-mocha":"^1.3.0","karma-spec-reporter":"^0.0.32","lint-staged":"^7.2.2","memory-fs":"^0.4.1","mocha":"^5.2.0","nsp":"^3.2.1","pre-commit":"^1.2.2","prettier":"^1.14.2","puppeteer":"^5.5.0","standard-version":"^4.4.0","webpack":"^5.10.0"},"keywords":["webpack"],"jest":{"testEnvironment":"node"},"pre-commit":"lint-staged","lint-staged":{"*.js":["eslint --fix","git add"]},"gitHead":"46a5505f9bf976d386eb651fafe4b1284cb2f04f","_id":"karma-webpack@5.0.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-+54i/cd3/piZuP3dr54+NcFeKOPnys5QeM1IY+0SPASwrtHsliXUiCL50iW+K9WWA7RvamC4macvvQ86l3KtaA==","shasum":"2a2c7b80163fe7ffd1010f83f5507f95ef39f840","tarball":"http://registry-npm.ywwl.com/karma-webpack/download/karma-webpack-5.0.0.tgz","fileCount":13,"unpackedSize":36396,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2xBsCRA9TVsSAnZWagAAub0P/Rwy+Vo9A6x9WkSDVXPh\nCEBt9V/ztnbAp7WykvcoVSRWDiIrZZktDjsstmTYk2BKY4Tf9Ahug4rPL0QF\nhvhTWvhVQmNnfO31Hvkqwj8xpeSkqz+SYpsSMcnh8Lxb20dik897IGIuK4uz\nVW91eX4V6yqWCvJnaUQ15xVGn7bjmmATwv9qMxW8elhLPJ4fmek8Y7qNEfkC\nkypUkceIGmVcdKAtvPqmdNhKmc2yJ3kcl/3V2gbIY1/iKZZQZOsaAhFIQ1E0\nWcaJhHxu1/LMfkVVUu6vPnKwSCP+tidE906v7aGdOE395lo2XwX1O1ydZmWB\nJ2XgIuIAzcuhj2uD5BuArD+g4hRMBIH/HEEZ0ZJOK9zyPBqj1a/S3Y7JrwaN\nGUX+G8kIIj1kL1Ss+eKh7hR8+4hrqnCT8tKvM6kQyl872eLAi6HdFlg6gviY\nwKChGTWrRLUgmmZuX7gYKF+izxQ4SeVBLsvn5RT7Jhkp9fum9JaaYETXINYq\nO/8eVdlpR1HCQOKSTQtiIYB+yJn5JG2Kc04kuaAinQ21w6iVdVhaSGSiz6hB\n2DNBsQVU9De/DAMAlnfvu3lO83p4pJyM6ibfzjomd+7pNvHOL7G4PnPDFZ0K\noJrxv/iL/PKS5hW5+A4KggN8lmFww4Fzm9teCqra2DEEiS60Yq5akNnaQbSD\nPOli\r\n=LOK4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDtgTM3fwZlm0Glpci7y1jDYvCiTQ6zBWBZSLou0bK0pQIgGN9xYQ7VAEHw6ZaWgWh9cBL6deABJPn797EjIkDiRG4="}],"size":10507,"noattachment":false,"key":"/karma-webpack/-/karma-webpack-5.0.0.tgz"},"_npmUser":{"name":"ryanclark","email":"ryan@ryanclark.me"},"directories":{},"maintainers":[{"name":"evilebottnawi","email":"sheo13666q@gmail.com"},{"name":"sokra","email":"tobias.koppers@googlemail.com"},{"name":"jhnns","email":"mail@johannesewald.de"},{"name":"michael-ciniawsky","email":"michael.ciniawsky@gmail.com"},{"name":"d3viant0ne","email":"wiens.joshua@gmail.com"},{"name":"ryanclark","email":"ryan@ryanclark.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/karma-webpack_5.0.0_1612266894550_0.9917093856646158"},"_hasShrinkwrap":false,"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":1612266894710,"_cnpm_publish_time":1612266894710,"dist-tags":{"dev":"5.0.0-alpha.3.0","latest":"5.0.1","next":"5.0.0-alpha.6"}}