Download internal/vite-config/src/plugins/print.ts from binhugg3/admin: direct link, hf CLI and curl.
- Browser
- Download file 673 Bytes
-
https://huggingface.co/spaces/binhugg3/admin/resolve/main/internal/vite-config/src/plugins/print.ts
- Command line
-
hf download hf://spaces/binhugg3/admin/internal/vite-config/src/plugins/print.ts
-
curl -L -o print.ts https://huggingface.co/spaces/binhugg3/admin/resolve/main/internal/vite-config/src/plugins/print.ts
673 Bytes
| import type { PluginOption } from 'vite'; | |
| import type { PrintPluginOptions } from '../typing'; | |
| import { colors } from '@vben/node-utils'; | |
| export const vitePrintPlugin = ( | |
| options: PrintPluginOptions = {}, | |
| ): PluginOption => { | |
| const { infoMap = {} } = options; | |
| return { | |
| configureServer(server) { | |
| const _printUrls = server.printUrls; | |
| server.printUrls = () => { | |
| _printUrls(); | |
| for (const [key, value] of Object.entries(infoMap)) { | |
| console.log( | |
| ` ${colors.green('➜')} ${colors.bold(key)}: ${colors.cyan(value)}`, | |
| ); | |
| } | |
| }; | |
| }, | |
| enforce: 'pre', | |
| name: 'vite:print-info', | |
| }; | |
| }; | |