vConsole plugin for vite, support both MPA
and SPA
.
yarn add vite-plugin-simple-vconsole -D
# or
npm i vite-plugin-simple-vconsole -D
See example
cd example
# yarn
yarn
yarn dev
# pnpm
pnpm i
pnpm dev
// vite.config.js
import vConsolePlugin from 'vite-plugin-simple-vconsole'
export default {
plugins: [
vConsolePlugin({
enable: true,
}),
]
}
interface VConsolePluginOptions {
enable?: boolean;
src?: string; // cdn url, default is https://unpkg.com/vconsole@latest/dist/vconsole.min.js
theme?: 'light' | 'dark';
injectTo?: 'head' | 'body'; // default 'head'
}
- Type:
boolean
- Default:
false
- Type:
string
- Default:
'https://unpkg.com/vconsole@latest/dist/vconsole.min.js'
this script will be injected to body of the entry html
- Type:
'light' | 'dark'
- Default:
'light'
vConosle theme