Warning you impolite words in the development console for Vite, Webpack, and Rollup
npm i unplugin-keep-polite --save-dev
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(),
],
})
- Auto-replace impolite words
- Type: Boolean
- Default:
false
- Replace impolite words
- Type: String
- Default:
true
- Custom dictionary for impolite words
- Type: String[] | { path: string }
- Default:
undefined
- Example:
{ path: 'dict.json' }
- Add extra dictionary for impolite words
- Type: String[]
- Default:
[]
- Example:
[]