mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-29 17:07:22 +00:00
12 lines
311 B
TypeScript
12 lines
311 B
TypeScript
import { relative } from 'path'
|
|
import jiti from 'jiti'
|
|
|
|
export const hl = str => '`' + str + '`'
|
|
|
|
export const prettyPath = (p, highlight = true) => {
|
|
p = relative(process.cwd(), p)
|
|
return highlight ? hl(p) : p
|
|
}
|
|
|
|
export const tryImport = (dir, path) => { try { return jiti(dir)(path) } catch (_err) { } }
|