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

webpack-stylish

v0.1.8

Published

A stylish reporter for webpack

Downloads

2,736

Readme

npm node deps tests chat

webpack-stylish

A stylish, opinionated reporter for webpack.

Compared to the default output:

Let's be honest, the default build output for webpack wouldn't exactly hang in the Louvre. Great tools should have beautiful output. This reporter is specifically structured to present common, important¹ information about a build in a visually pleasing and easy-to-read format and style.

¹ subjective, but based on shared experiences.

Getting Started

To begin, you'll need to install webpack-stylish:

$ npm install webpack-stylish --save-dev

Then add the reporter as a plugin to your webpack config. For example:

const path = require('path');
const webpack = require('webpack');
const Stylish = require('webpack-stylish');

module.exports = {
  context: path.resolve(__dirname),
  devtool: 'source-map',
  entry: './entry.js',
  output: {
    filename: './output.js',
    path: path.resolve(__dirname)
  },
  plugins: [
    new webpack.NamedModulesPlugin(),
    new Stylish()
  ]
};

MultiCompilers

If you use a config that consists of an array of configs (aka. MultiCompiler), we recommend using a single instance of the reporter across all configs. eg;

const StylishReporter = require('webpack-stylish');
const stylish = new StylishReporter();

module.exports = [
  {
    ...
    plugins: [
      new webpack.NamedModulesPlugin(),
      stylish
    ]
  },
  {
    ...
    plugins: [
      new webpack.NamedModulesPlugin(),
      stylish
    ]
  }
];

Internally, the reporter will keep track of the compiler instances it's been added to and will display summary information for all compilers. If you don't use a single, shared instance of the reporter, you're going to see a lot of duplicate information, and that'd just be silly.

Webpack CLI

Because webpack-cli reads the stats config property before the compilation starts, it tends to go on doing it's own thing. When using webpack-stylish in a config that you're running via the CLI, you need to add stats: 'none' to the config. Otherwise you'll see both this reporter's output, and the CLI's.

Options

There are none! If you're in need of fine-grained control of webpack's build information out, please don't use this reporter. Instead, you can fine-tune webpack's default output via the stats config property.

Gotchas

The webpack-stylish reporter will straight up ignore the stats property in your webpack config, if you have one set. (This reporter is opinionated!).

Naughty Loaders and Plugins

Some loaders and plugins are going to need a spanking. For they have been naughty and are pushing wonky formatting and multiple-errors-packed-into-one errors onto a compliation's error and/or warning stacks. webpack-stylish does it's best to compensate for that, but be aware that some plugins will cause some wonky output. For example, stylelint-webpack-plugin is guilty of this.

It's impossible for us to test the world (aka. every plugin ever) so if you see something off, please open an issue and let us know. We'll either compensate further in the code here, or try to bring the offending plugin or loader into the light.

Contributing

We welcome your contributions! Please have a read of CONTRIBUTING.md for more information on how to get involved.

License

MIT