/
githubmirror
/
stackwise
Обзор
Документация
Войти
/
githubmirror
/
stackwise
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
tooling/tailwind-config/node_modules/tailwindcss/src/lib/load-config.ts
39 строк
851 B
Silen Naihin
moving files to root
17 фев 2024, 21:26
17 фев 2024, 21:26
7f5dc43
Код
Авторство
О чём код?
import jitiFactory from 'jiti' import { transform } from 'sucrase' import { Config } from '../../types/config' let jiti: ReturnType<typeof jitiFactory> | null = null // @internal // This WILL be removed in some future release // If you rely on this your stuff WILL break export function useCustomJiti(_jiti: ReturnType<typeof jitiFactory>) { jiti = _jiti } function lazyJiti() { return ( jiti ?? (jiti = jitiFactory(__filename, { interopDefault: true, transform: (opts) => { return transform(opts.source, { transforms: ['typescript', 'imports'], }) }, })) ) } export function loadConfig(path: string): Config { let config = (function () { try { return path ? require(path) : {} } catch { return lazyJiti()(path) } })() return config.default ?? config }