eslint-rule-benchmark
Version:
Benchmark ESLint rules with detailed performance metrics for CI and plugin development
17 lines (16 loc) • 384 B
JavaScript
import { createJiti } from 'jiti'
let jiti = createJiti(import.meta.url, {
interopDefault: true,
requireCache: false,
})
let jitiLoader = async (filepath, _content) => {
try {
let loader = await jiti.import(filepath)
return loader.default
} catch (error) {
throw new Error(`Error loading file ${filepath}`, {
cause: error,
})
}
}
export { jitiLoader }