1.0.0 • Published 8 months ago

@brokenice/vite-build-notifier v1.0.0

Weekly downloads
-
License
Apache 2.0
Repository
github
Last release
8 months ago

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

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
1.0.0

8 months ago