Skip to content

Commit

Permalink
Resolve module relative to working dir
Browse files Browse the repository at this point in the history
  • Loading branch information
bas080 committed May 6, 2023
1 parent 79b3981 commit 83dfab0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cli.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import yargs from 'yargs/yargs'
import { hideBin } from 'yargs/helpers'
import schema from './schema.mjs'
import serve from './server.mjs'
import path from 'node:path'

const name = 'furver'
process.title = name
Expand Down Expand Up @@ -34,6 +35,8 @@ if (argv.verbose) {
async function createApi (modules) {
const api = await modules.reduce(async (merged, filePath) => {
merged = await merged
if (filePath.startsWith('.')) { filePath = path.join(process.cwd(), filePath) }

const mod = await import(filePath)
const exported = mod.default || mod

Expand Down

0 comments on commit 83dfab0

Please sign in to comment.