https://github.com/tuchk4/webpack-build-logger
log build done / success / error events
https://github.com/tuchk4/webpack-build-logger
Last synced: about 1 year ago
JSON representation
log build done / success / error events
- Host: GitHub
- URL: https://github.com/tuchk4/webpack-build-logger
- Owner: tuchk4
- Created: 2016-01-12T10:51:13.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-07-24T10:04:36.000Z (almost 9 years ago)
- Last Synced: 2024-04-13T16:04:14.538Z (about 2 years ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 0
- Watchers: 4
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Webpack build logger
## Add events "build.start"
## Add events "build.done"
Arguments
- `counter` current rebuild number
- `time` time in seconds that spent for rebuilding
- `scripts` all modules that are included in current build
- `warnings` array of warnings
## Add events "build.error"
Arguments
- `errors` array of errors
## Install
`npm install --save webpack-build-logger`
## Setup
By default - plugin provide only event emmiting but auto logging could be configured.
```js
import WebpackBuildLogger form 'webpack-build-logger'
let webpackBuildLogger = new WebpackBuildLogger({
logEnabled: true, // false - default
logger: (counter, time, scripts, warnings) => { // by default - console.log will be used
customLogger(counter, time, scripts, warnings)
}
});
```
## How to use
```js
import WebpackBuildLogger form 'webpack-build-logger'
...
webpack.config.plugins.push(new WebpackBuildLogger());
...
let instance = Webpack(config);
instance.on('build.start', () => {
...
});
instance.on('build.done', (counter, time, scripts, warnings) => {
});
instance.on('build.error', (errors) => {
...
});
```