one
Version:
One is a new React Framework that makes Vite serve both native and web.
14 lines (11 loc) • 375 B
text/typescript
import Glob from 'fast-glob'
// Used to emulate a context module, but way faster. TODO: May need to adjust the extensions to stay in sync with Metro.
export function globDir(cwd: string) {
return Glob.sync('**/*.@(ts|tsx|js|jsx)', {
cwd,
dot: true,
}).map((p) => './' + normalizePaths(p))
}
function normalizePaths(p: string) {
return p.replace(/\\/g, '/')
}