0.0.7 • Published 2 years ago

unplugin-vconsole-import v0.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

unplugin-vconsole-import

NPM version

Use the function of VConsole in various environments. Use in vite, webpack, rollup, esbuild

Install

pnpm install vconsole

pnpm install unplugin-vconsole-import -D

Usage

  • vite
import { resolve } from 'path'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import viteVConsole from 'unplugin-vconsole-import/vite';

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    vue(),
    viteVConsole({
      entry: resolve(__dirname, './src/main.ts'),
      // enabled: false,
    }),
  ],
})
  • webpack
// 引入插件
const webpackVConsole = require('unplugin-vconsole-import/webpack');

...

{
  ...
  plugins: [
    webpackVConsole({
      entry: resolve(__dirname, './src/main.ts'),
      // enabled: false,
    }),
    ...
  ]
  ...
}

Options

{
  entry: string | string[]; // entry file that you want to use vconsole
  enabled?: boolean;
  config?: { // vconsole's options
    defaultPlugins?: string[];
    onReady?: () => void;
    onClearLog?: () => void;
    maxLogNumber?: number;
    disableLogScrolling?: boolean;
    theme?: 'light' | 'dark';
  };
}

License

MIT License © 2022 fightwithtiger

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.1

2 years ago

0.0.0

2 years ago