Skip to content

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

License

Notifications You must be signed in to change notification settings

geomatico/exit-on-error-webpack-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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: codymikol/karma-webpack#66 (comment)

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()
        ]
    }
    // ...
};

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published