0.0.2 • Published 2 years ago
vite-plugin-logs v0.0.2
vite-plugin-logs
A vite plugin for html inject logs
Install
npm install vite-plugin-logs D
Usage
import { defineConfig } from 'vite'
import logs, { preset } from 'vite-plugin-logs'
export default defineConfig(({ mode }) => {
return {
plugins: [
logs(
preset([
{ type: 'darkblue:gray', label: '..', value: '{_name_}' },
{ type: 'darkblue:green', label: '..', value: mode },
{ type: 'darkblue:blue', label: '..', value: '{_version_}' },
{ type: 'darkblue:blue', label: '..', value: '{_time_}' },
])
),
]
}
})
Custom
import { defineConfig } from 'vite'
export default defineConfig(({ mode }) => {
return {
plugins: [
logs([
[
{ text: 'Project', style: {/* ... */} },
{ text: ' {_NAME_} ', style: {/* ... */} },
],
[
{ text: 'Environment', style: {/* ... */} },
{ text: ` ${mode} `, style: {/* ... */} },
],
// ....
]),
]
}
})