UNPKG

svelte-standalone

Version:

Transform Svelte components in standalone scripts!

5 lines (4 loc) 224 B
import { rootDir } from '../../dir.js'; import path from 'path'; import { existsSync } from 'fs'; export const getPath = (p) => ['.js', '.ts'].map((ext) => path.resolve(rootDir, `${p}${ext}`)).find(existsSync) || undefined;