Skip to content

A Vite plugin that generates OS notifications for build steps using node-notifier.

License

Notifications You must be signed in to change notification settings

brokenicedev/vite-build-notifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Build Status

compiling.png compiling.png

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
  )]
});

exe. with no sounds:

import ViteBuildNotifierPlugin from "@brokenice/vite-build-notifier"
export default defineConfig({
  plugins: [ViteBuildNotifierPlugin(null,false,true)]
});

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

About

A Vite plugin that generates OS notifications for build steps using node-notifier.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published