English | ไธญๆ
System notification of build results, automatically opens the project root directory.
- ๐ High-priority system notifications, supported by node-notifier.
- โจ Automatically obtain the project name
- ๐ Automatically open the file explorer
- ๐ง Configurable messages and click behavior
- ๐ Get build time
- โก๏ธ Supports Vite, Webpack, Rspack, Vue CLI, Rollup, esbuild and more, powered by unplugin.
- ๐ฆพ Full TypeScript support.
npm i unplugin-build-notifier -D
yarn add unplugin-build-notifier -D
pnpm add unplugin-build-notifier -D
Vite
// vite.config.ts
import BuildNotifier from 'unplugin-build-notifier/vite'
export default defineConfig({
plugins: [
BuildNotifier({ /* options */ }),
],
})
Example: playground/
Rollup
// rollup.config.js
import BuildNotifier from 'unplugin-build-notifier/rollup'
export default {
plugins: [
BuildNotifier({ /* options */ }),
],
}
Webpack
// webpack.config.js
module.exports = {
/* ... */
plugins: [
require('unplugin-build-notifier/webpack')({ /* options */ })
]
}
Nuxt
// nuxt.config.js
export default defineNuxtConfig({
modules: [
['unplugin-build-notifier/nuxt', { /* options */ }],
],
})
This module works for both Nuxt 2 and Nuxt Vite
Vue CLI
// vue.config.js
module.exports = {
configureWebpack: {
plugins: [
require('unplugin-build-notifier/webpack')({ /* options */ }),
],
},
}
esbuild
// esbuild.config.js
import { build } from 'esbuild'
import BuildNotifier from 'unplugin-build-notifier/esbuild'
build({
plugins: [BuildNotifier()],
})
/**
* plugin options.
*/
interface Options {
/**
* The message to display in the build notifier.
*/
message?: string
/**
* The path to the icon to display in the build notifier.
*/
iconPath?: string
/**
* The callback function to execute when the build notifier is clicked.
*/
click?: () => void
/**
* The callback function to execute when the build notifier times out.
*/
timeout?: () => void
}