Skip to content

Latest commit

 

History

History
166 lines (121 loc) · 3.46 KB

README.zh-cn.md

File metadata and controls

166 lines (121 loc) · 3.46 KB

logo

unplugin-notifier

当打包器构建发生错误时发送原生通知,由 unpluginnode-notifier 强力驱动

npm version npm downloads bundle License JSDocs

English | 简体中文

预览

Windows

Windows Preview


MacOS

MacOS Preview


Linux

Linux Preview


安装

npm i unplugin-notifier

查看 node-notifier 的要求的依赖 ,以确定是否需要为系统安装额外的库。

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 (⚠️ 实验性)
// rspack.config.js
module.exports = {
  plugins: [
    require('unplugin-notifier/rspack')({ /* options */ }),
  ],
}