Files
copy-tab-url/scripts/utils.ts
2024-10-04 03:33:41 +03:00

17 lines
599 B
TypeScript

import { resolve } from 'path'
import { bgCyan, black } from 'kolorist'
import react from '@vitejs/plugin-react'
const __dirname = import.meta.dirname
export const fastRefresh = true
export const port = parseInt(process.env.PORT || '') || 3303
export const r = (...args: string[]) => resolve(__dirname, '..', ...args)
export const isDev = process.env.NODE_ENV !== 'production'
export const preambleCode = react.preambleCode.replace('__BASE__', '/')
export function log(name: string, message: string) {
// eslint-disable-next-line no-console
console.log(black(bgCyan(` ${name} `)), message)
}