Skip to content

KeJunMao/unplugin-notifier

Repository files navigation

logo

unplugin-notifier

Send native notifications when an error occurs in a bundler build, Powered by unplugin and node-notifier.

npm version npm downloads bundle License JSDocs

English | 简体中文

Preview

Windows

Windows Preview


MacOS

MacOS Preview


Linux

Linux Preview


Install

npm i unplugin-notifier

Check the node-notifier requirements whether you need to install any additional tools for your OS.

Vite
// vite.config.ts
import Notifier from 'unplugin-notifier/vite'

export default defineConfig({
  plugins: [
    Notifier({ /* options */ }),
  ],
})

Example: playground/


Rollup
// rollup.config.js
import Notifier from 'unplugin-notifier/rollup'

export default {
  plugins: [
    Notifier({ /* options */ }),
  ],
}


Webpack
// webpack.config.js
module.exports = {
  /* ... */
  plugins: [
    require('unplugin-notifier/webpack')({ /* options */ })
  ]
}


Nuxt
// nuxt.config.js
export default defineNuxtConfig({
  modules: [
    ['unplugin-notifier/nuxt', { /* options */ }],
  ],
})

This module works for both Nuxt 2 and Nuxt Vite


Vue CLI
// vue.config.js
module.exports = {
  configureWebpack: {
    plugins: [
      require('unplugin-notifier/webpack')({ /* options */ }),
    ],
  },
}


esbuild
// esbuild.config.js
import { build } from 'esbuild'
import Notifier from 'unplugin-notifier/esbuild'

build({
  plugins: [Notifier()],
})


Rspack (⚠️ experimental)
// rspack.config.js
module.exports = {
  plugins: [
    require('unplugin-notifier/rspack')({ /* options */ }),
  ],
}