exit-on-error-webpack-plugin

0.0.2 • Public • Published

exit-on-error-webpack-plugin

Created to force karma fail when webpack fails, thus preventing, for instance, a successful test run while having TypeScript errors.

Based on contributions from this thread: https://github.com/ryanclark/karma-webpack/issues/66#issuecomment-438278234

Usage

Install:

npm install exit-on-error-webpack-plugin --save-dev

Add plugin to webpack.config.js:

const ExitOnErrorPlugin = require('exit-on-error-webpack-plugin');

module.exports = {
  // ...
  plugins: [new ExitOnErrorPlugin()],
  // ...
};

Or, if to be applied only on karma-webpack, add it to karma.config.js:

const ExitOnErrorPlugin = require('exit-on-error-webpack-plugin');
const webpackConfig = require('../webpack.config.js');

module.exports = function() {
    // ...
    webpack: {
        ...webpackConfig,
        plugins: [
            ...webpackConfig.plugins,
            new ExitOnErrorPlugin()
        ]
    }
    // ...
};

Readme

Keywords

none

Package Sidebar

Install

npm i exit-on-error-webpack-plugin

Weekly Downloads

12

Version

0.0.2

License

MIT

Unpacked Size

2.93 kB

Total Files

4

Last publish

Collaborators

  • oscarfonts