@mattlewis92/webpack-karma-die-hard

1.0.4 • Public • Published

npm npm npm

Plugin for Webpack to ensure errors cause it to quit with a non-zero exit code when used as a Karma preprocessor with the karma-webpack plugin. This works around known issues in karma-webpack.

Install

Installable through npm:

npm install --save-dev webpack-karma-die-hard

Usage

This plugin is not necessary for building with Webpack directly, so it should not be added to your webpack.config.js file. It should instead extend the Webpack configuration used by Karma when using Webpack as a preprocessor.

Inside your karma.conf.js file:

var WebpackKarmaDieHardPlugin = require('webpack-karma-die-hard');

var webpackConfig = require('./webpack.config');

module.exports = function (config) {
  config.set({
    /* Karma configuration omitted for brevity... */

    preprocessors: {
      'test/**/*.ts': ['webpack']
    },

    webpack: {
      module: webpackConfig.module,
      resolve: webpackConfig.resolve,
      plugins: [ new WebpackKarmaDieHardPlugin() ]
    }
  })
}

Options

The plugin takes an optional options object with the following options:

  • color: set to "false" to prevent colored logging to the console.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.4
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.4
    2

Package Sidebar

Install

npm i @mattlewis92/webpack-karma-die-hard

Weekly Downloads

2

Version

1.0.4

License

BSD-3-Clause

Last publish

Collaborators

  • mattlewis92