Sounds Webpack Plugin
Notify or errors, warnings, etc with sounds
Installation
npm install sounds-webpack-plugin
Usage
Basic usage with defaults
// webpack.config.jsconst SoundsPlugin = moduleexports = plugins:
You can provide custom sounds to be loaded:
// webpack.config.jsconst SoundsPlugin = const path = moduleexports = plugins: sounds: customSound: path customWarning: path customSuccess: path notifications: // invalid is a webpack hook // you can check all hooks at https://github.com/webpack/webpack/blob/master/lib/Compiler.js#L32 // 'customSound' is the key provided in sounds invalid: 'customSound' // you can provide a function to customize it further { if stats this else if stats this else this }
You can provide 3 special values that are not webpack hooks: $hasErrors
, $hasWarnings
, $success
and $successAfterError
. You can check default values here. You can of course override any of them in sounds
option.
SoundsPlugin comes with 4 sounds:
oof
- used for errors by defaultnope
:xpError
:levelUp
: - used when the build succeeds after an error
SoundsPlugin uses play-sound under the hood. You can pass down options to the player with playerOptions
:
// webpack.config.jsconst SoundsPlugin = moduleexports = plugins: playerOptions: // check https://github.com/shime/play-sound#options // osx uses afplay