@brokenice/vite-build-notifier
v1.0.0
Published
A [Vite](https://vitejs.dev/) plugin that uses the [node-notifier](https://github.com/mikaelbr/node-notifier) package to display OS-level notifications for Webpack build events.
Downloads
2
Readme
Vite Build Notifier
A Vite plugin that uses the node-notifier package to display OS-level notifications for Webpack build events.
vite-build-notifier can generate notifications for compilation errors, as well as notify you when the compilation process is triggered and completes successfully.
Install
npm i --save-dev @brokenice/vite-build-notifier
Usage
add blow codes to vite.config.js
import ViteBuildNotifierPlugin from "@brokenice/vite-build-notifier"
export default defineConfig({
plugins: [ViteBuildNotifierPlugin()]
});
##Options
import ViteBuildNotifierPlugin from "@brokenice/vite-build-notifier"
export default defineConfig({
plugins: [ViteBuildNotifierPlugin(
options, // exe. {title: 'test', message: 'new message'}
suppressOnStart,
suppressSound,
onStart,
onEnd
)]
});
Config Options
options
You can refer to node-notifier options
onStart
A function which is invoked when compilation starts. Optional. The function has no paramters.
onEnd
A function which is invoked when compilation completes. Optional. The function is passed one parameter:
- {Error} containing compilation error
suppressOnStart
Disable notifications when a new compile process starts.
suppressSound
Suppress sounds
Todo
- Add support for warnings