Skip to content

tangdaoyuan/unplugin-keep-polite

Repository files navigation

unplugin-keep-polite

Warning you impolite words in the development console for Vite, Webpack, and Rollup

Install

npm i unplugin-keep-polite --save-dev

Usage

Vite
import unPluginPolite from 'unplugin-keep-polite'
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    // ...
    unPluginPolite.vite(),
  ],
  // ...
})
Webpack
import unPluginPolite from 'unplugin-keep-polite'

export default {
  entry: './src/index.js',
  output: {
    path: path.resolve(__dirname, 'dist'),
    filename: 'bundle.js',
  },
  plugins: [unPlugin.webpack()],
}
Rollup
import { defineConfig } from 'rollup'
import unPluginPolite from 'unplugin-keep-polite'

export default defineConfig({
  input: 'src/index.ts',
  output: {
    file: 'dist/bundle.js',
    format: 'cjs',
  },
  plugins: [
    unPluginPolite.rollup(),
  ],
})

Options

autoReplace

  • Auto-replace impolite words
  • Type: Boolean
  • Default: false

replacer

  • Replace impolite words
  • Type: String
  • Default: true

customDict

  • Custom dictionary for impolite words
  • Type: String[] | { path: string }
  • Default: undefined
  • Example: { path: 'dict.json' }

extraDict

  • Add extra dictionary for impolite words
  • Type: String[]
  • Default: []
  • Example: []

About

☕️ A plugin for keeping polite with you

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published