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.
npm i --save-dev @brokenice/vite-build-notifier
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
)]
});
exe. with no sounds:
import ViteBuildNotifierPlugin from "@brokenice/vite-build-notifier"
export default defineConfig({
plugins: [ViteBuildNotifierPlugin(null,false,true)]
});
You can refer to node-notifier options
A function which is invoked when compilation starts. Optional. The function has no paramters.
A function which is invoked when compilation completes. Optional. The function is passed one parameter:
- {Error} containing compilation error
Disable notifications when a new compile process starts.
Suppress sounds
- Add support for warnings