3.0.0 • Published 4 years ago

clean-terminal-webpack-plugin v3.0.0

Weekly downloads
12,464
License
MIT
Repository
github
Last release
4 years ago

Clean Terminal Webpack Plugin

Cleans your terminal output during development to only show the latest build information.

Install

Via npm:

npm i -D clean-terminal-webpack-plugin

Usage

Via webpack config file:

// webpack.config.js

const CleanTerminalPlugin = require('clean-terminal-webpack-plugin');

module.exports = {
  plugins: [new CleanTerminalPlugin()]
};

API

The plugin accepts an options Object:

KeyTypeRequiredDefaultDescription
messageStringnoundefinedMessage to be printed
onlyInWatchModeBooleannotrueOnly clear the screen if webpack is in watch mode
skipFirstRunBooleannofalseDon't clear the screen on first webpack run
beforeCompileBooleannofalseClear screen before compiling instead of after (v3 and above)

Example

// webpack.config.js

const CleanTerminalPlugin = require('clean-terminal-webpack-plugin');

const HOST = 'localhost';
const PORT = 8888;

module.exports = {
  plugins: [
    new CleanTerminalPlugin({
      message: `dev server running on http://${HOST}:${PORT}`,
      onlyInWatchMode: false
    })
  ]
};

Development

Lint source code with:

npm run lint

Lint and format (prettier) source code with:

npm run lint:format

Contributing

Please read the Contributing Guidelines first.