From 701a082ce4765bffb151472d40406143c98c6215 Mon Sep 17 00:00:00 2001 From: Cody Mikol Date: Sat, 21 Oct 2023 20:45:10 -0400 Subject: [PATCH] chore: fix maintainers images being squished (#576) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit seemed disrespectful 🤷 Fixes N/A --- README.md | 121 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 71 insertions(+), 50 deletions(-) diff --git a/README.md b/README.md index 077eb80..e592524 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ yarn `yarn add -D karma-webpack`

Usage

**karma.conf.js** + ```js module.exports = (config) => { config.set({ @@ -31,7 +32,7 @@ module.exports = (config) => { // make sure to include webpack as a framework frameworks: ['mocha', 'webpack'], - + plugins: [ 'karma-webpack', 'karma-mocha', @@ -40,12 +41,12 @@ module.exports = (config) => { files: [ // all files ending in ".test.js" // !!! use watched: false as we use webpacks watch - { pattern: 'test/**/*.test.js', watched: false } + {pattern: 'test/**/*.test.js', watched: false} ], preprocessors: { // add webpack as preprocessor - 'test/**/*.test.js': [ 'webpack' ] + 'test/**/*.test.js': ['webpack'] }, webpack: { @@ -95,13 +96,17 @@ const defaultWebpackOptions = { ### How it works -This 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. +This 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. -The first preproccessor triggers the build of all the bundles/chunks and all following files just return the output of this one build process. +The first preproccessor triggers the build of all the bundles/chunks and all following files just return the output of +this one build process. ### Webpack typescript support -By 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. +By 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. If you have a different need you can override by settig `webpack.transformPath` @@ -109,11 +114,12 @@ If you have a different need you can override by settig `webpack.transformPath` // this is the by default applied transformPath webpack: { transformPath: (filepath) => { - // force *.js files by default - const info = path.parse(filepath); - return `${path.join(info.dir, info.name)}.js`; - }, -}, + // force *.js files by default + const info = path.parse(filepath); + return `${path.join(info.dir, info.name)}.js`; + }, +} +, ``` ### `Source Maps` @@ -127,15 +133,19 @@ npm i -D karma-sourcemap-loader And then add it to your preprocessors. **karma.conf.js** + ```js preprocessors: { - 'test/test_index.js': [ 'webpack', 'sourcemap' ] + 'test/test_index.js' +: + ['webpack', 'sourcemap'] } ``` And tell `webpack` to generate sourcemaps. **webpack.config.js** + ```js webpack: { // ... @@ -143,82 +153,93 @@ webpack: { } ``` + +

Current Maintainers

- - - - - - -
- -
- Cody Mikol -
+
+
+ + Cody Mikol +
+
+

Previous Maintainers

-Previous maintainers of the `karma-webpack` plugin that have done such amazing work to get it to where it is today. +Previous maintainers of the `karma-webpack` plugin that have done such amazing work to get it to where it is today. 🎉🎉🎉 - - - - - - - - - + - - - - -
+
+
+ + + + + + + + + +
+ + +
+ + [npm]: https://img.shields.io/npm/v/karma-webpack.svg + [npm-url]: https://npmjs.com/package/karma-webpack [node]: https://img.shields.io/node/v/karma-webpack.svg + [node-url]: https://nodejs.org [cover]: https://codecov.io/gh/webpack-contrib/karma-webpack/branch/master/graph/badge.svg + [cover-url]: https://codecov.io/gh/webpack-contrib/karma-webpack