Skip to content

Commit

Permalink
Merge pull request #8 from caiodomingues/patch-1
Browse files Browse the repository at this point in the history
fix(config): load file with native pathToFileURL()
  • Loading branch information
pontusab authored Dec 23, 2024
2 parents bb6937f + ba08999 commit 895c902
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/cli/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { confirm, outro, text } from "@clack/prompts";
import chalk from "chalk";
import dedent from "dedent";
import type { Config } from "./types.js";
import { pathToFileURL } from 'url';

export async function getApiKey(name: string, key: string) {
if (key in process.env) {
Expand Down Expand Up @@ -64,7 +65,7 @@ export const configPath = path.join(process.cwd(), "languine.config.mjs");
export async function getConfig() {
let config: Config;
try {
const configModule = await import(configPath);
const configModule = await import(pathToFileURL(configPath).href);
config = configModule.default;
} catch (error) {
console.error(error);
Expand Down

0 comments on commit 895c902

Please sign in to comment.