Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/venojs/vite-plugin-simple-vconsole
vConsole plugin for vite, easy to use
https://github.com/venojs/vite-plugin-simple-vconsole
Last synced: 3 months ago
JSON representation
vConsole plugin for vite, easy to use
- Host: GitHub
- URL: https://github.com/venojs/vite-plugin-simple-vconsole
- Owner: venojs
- License: mit
- Created: 2022-03-03T08:32:47.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-03-05T12:49:50.000Z (11 months ago)
- Last Synced: 2024-07-31T22:38:50.497Z (6 months ago)
- Language: Vue
- Homepage:
- Size: 54.7 KB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- fucking-awesome-vite - vite-plugin-simple-vconsole - A debug console view inside your app to make mobile debugging easier, for both SPA and MPA. (Plugins / Framework-agnostic Plugins)
- awesome-vite - vite-plugin-simple-vconsole - A debug console view inside your app to make mobile debugging easier, for both SPA and MPA. (Plugins / Framework-agnostic Plugins)
README
# vite-plugin-simple-vconsole [![npm](https://img.shields.io/npm/v/vite-plugin-simple-vconsole.svg)](https://npmjs.com/package/vite-plugin-simple-vconsole)
[vConsole](https://github.com/Tencent/vConsole) plugin for vite, support both `MPA` and `SPA`.
## Install
```shell
yarn add vite-plugin-simple-vconsole -D
# or
npm i vite-plugin-simple-vconsole -D
```## Example
See [example](./example/)
```shell
cd example# yarn
yarn
yarn dev# pnpm
pnpm i
pnpm dev
```## Usage
```js
// vite.config.js
import vConsolePlugin from 'vite-plugin-simple-vconsole'export default {
plugins: [
vConsolePlugin({
enable: true,
}),
]
}
``````ts
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'
}
```## Options
### enable
- **Type:** `boolean`
- **Default:** `false`### src
- **Type:** `string`
- **Default:** `'https://unpkg.com/vconsole@latest/dist/vconsole.min.js'`this script will be injected to body of the entry html
### theme
- **Type:** `'light' | 'dark'`
- **Default:** `'light'`vConosle theme