An open API service indexing awesome lists of open source software.

https://github.com/kejunmao/unplugin-notifier

Send native notifications when an error occurs in a bundle build
https://github.com/kejunmao/unplugin-notifier

node-notifier notifications unplugin

Last synced: 6 months ago
JSON representation

Send native notifications when an error occurs in a bundle build

Awesome Lists containing this project

README

          

logo

# unplugin-notifier

Send native notifications when an error occurs in a bundler build, Powered by [unplugin](https://github.com/KeJunMao/unplugin-compression) and [node-notifier](https://github.com/mikaelbr/node-notifier/).

[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![bundle][bundle-src]][bundle-href]
[![License][license-src]][license-href]
[![JSDocs][jsdocs-src]][jsdocs-href]

English | [简体中文](./README.zh-cn.md)

## Preview

Windows

![Windows Preview](screenshot/windows.png)


MacOS

![MacOS Preview](screenshot/macos.png)


Linux

![Linux Preview](screenshot/linux.png)


## Install

```bash
npm i unplugin-notifier
```

Check the `node-notifier` [requirements](https://github.com/mikaelbr/node-notifier#requirements) whether you need to install any additional tools for your OS.

Vite

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

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

Example: [`playground/`](./playground/)


Rollup

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

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


Webpack

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


Nuxt

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

> This module works for both Nuxt 2 and [Nuxt Vite](https://github.com/nuxt/vite)


Vue CLI

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


esbuild

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

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


Rspack (⚠️ experimental)

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

[npm-version-src]: https://img.shields.io/npm/v/unplugin-notifier?style=flat&colorA=18181B&colorB=F0DB4F
[npm-version-href]: https://npmjs.com/package/unplugin-notifier
[npm-downloads-src]: https://img.shields.io/npm/dm/unplugin-notifier?style=flat&colorA=18181B&colorB=F0DB4F
[npm-downloads-href]: https://npmjs.com/package/unplugin-notifier
[bundle-src]: https://img.shields.io/bundlephobia/minzip/unplugin-notifier?style=flat&colorA=18181B&colorB=F0DB4F
[bundle-href]: https://bundlephobia.com/result?p=unplugin-notifier
[license-src]: https://img.shields.io/github/license/kejunmao/unplugin-notifier.svg?style=flat&colorA=18181B&colorB=F0DB4F
[license-href]: https://github.com/kejunmao/unplugin-notifier/blob/main/LICENSE
[jsdocs-src]: https://img.shields.io/badge/jsDocs.io-reference-18181B?style=flat&colorA=18181B&colorB=F0DB4F
[jsdocs-href]: https://www.jsdocs.io/package/unplugin-notifier