npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

tidy-errors-webpack-plugin

v0.0.6

Published

tidy errors webpack plugin

Downloads

43

Readme

Tidy-errors-webpack-plugin

npm Build Status

Tidy-errors-webpack-plugin recognizes certain classes of webpack errors and cleans, aggregates and prioritizes them to provide a better Developer Experience.

Getting started

Installation

npm install tidy-errors-webpack-plugin --save-dev

Basic usage

Simply add TidyErrorsWebpackPlugin to the plugin section in your Webpack config.

var TidyErrorsWebpackPlugin = require('tidy-errors-webpack-plugin');

var webpackConfig = {
  // ...
  plugins: [
    new TidyErrorsWebpackPlugin({
      errorsOnly: true
    }),
  ],
  // ...
}

Turn off errors

You need to turn off all error logging by setting your webpack config quiet option to true.

app.use(require('webpack-dev-middleware')(compiler, {
  quiet: true,
  publicPath: config.output.publicPath,
}));

If you use the webpack-dev-server, there is a setting in webpack's devServer options:

// webpack config root
{
  // ...
  devServer: {
    // ...
    quiet: true,
    // ...
  },
  // ...
}

If you use webpack-hot-middleware, that is done by setting the log option to a no-op. You can do something sort of like this, depending upon your setup:

app.use(require('webpack-hot-middleware')(compiler, {
  log: () => {}
}));

Options

You can pass options to the plugin:

new TidyErrorsPlugin({
  compilationSuccessInfo: {
    messages: ['You application is running here http://localhost:3000'],
    notes: ['Some additionnal notes to be displayed unpon successful compilation']
  },
  onErrors: function (errors) {
    // called when errors occured
  },
  onWarnings: function(warnings) {
    // called when warnings occured
  },
  // write all stats into file
  writeToFile: 'path/to/stats.json',
  // should show errors only or not
  errorsOnly: true,
  // dont show assets
  ignoreAsset: false,
  // should the console be cleared between each compilation?
  // default is true
  clearConsole: true
})

Adding desktop notifications

The plugin has no native support for desktop notifications but it is easy to add them thanks to node-notifier for instance.

var TidyErrorsPlugin = require('tidy-errors-webpack-plugin');
var notifier = require('node-notifier');
var ICON = path.join(__dirname, 'icon.png');

new TidyErrorsPlugin({
    onErrors: (,errors) => {
      const error = errors[0];
      notifier.notify({
        title: "Webpack error",
        message: error.name,
        subtitle: error.file || '',
        icon: ICON
      });
    }
  })
]

License

MIT License