@lx-frontend/unplugin-js-distribute
TypeScript icon, indicating that this package has built-in type declarations

0.0.1-beta.0 • Public • Published

unplugin-build-notifier

NPM version

English | 中文

System notification of build results, automatically opens the project root directory.


Features
  • 💚 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.

Install

npm i unplugin-build-notifier -D
yarn add unplugin-build-notifier -D
pnpm add unplugin-build-notifier -D

Template Usage

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()],
})


Options

/**
 * 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
}

/@lx-frontend/unplugin-js-distribute/

    Package Sidebar

    Install

    npm i @lx-frontend/unplugin-js-distribute

    Weekly Downloads

    0

    Version

    0.0.1-beta.0

    License

    ISC

    Unpacked Size

    32.5 kB

    Total Files

    46

    Last publish

    Collaborators

    • liuzihao0413
    • ruqimobile
    • haiyulu
    • erica.liuyj
    • pok.h
    • chenzian
    • azumia
    • jeely
    • lichao.franklee
    • mind29
    • yuki.liu
    • lixinleon
    • frontbot
    • owen.huang
    • tiny.tu
    • simba.wang