Skip to content

Latest commit

 

History

History
95 lines (71 loc) · 1.45 KB

README.md

File metadata and controls

95 lines (71 loc) · 1.45 KB

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: []