Cleans your terminal output during development to only show the latest build information.
Via npm:
npm i -D clean-terminal-webpack-plugin
Via webpack config file:
// webpack.config.js
const CleanTerminalPlugin = require('clean-terminal-webpack-plugin');
module.exports = {
plugins: [new CleanTerminalPlugin()]
};
The plugin accepts an options
Object:
Key | Type | Required | Default | Description |
---|---|---|---|---|
message |
String | no | undefined |
Message to be printed |
onlyInWatchMode |
Boolean | no | true |
Only clear the screen if webpack is in watch mode |
skipFirstRun |
Boolean | no | false |
Don't clear the screen on first webpack run |
beforeCompile |
Boolean | no | false |
Clear screen before compiling instead of after (v3 and above) |
// 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
})
]
};
Lint source code with:
npm run lint
Lint and format (prettier) source code with:
npm run lint:format
Please read the Contributing Guidelines first.