Skip to content

Commit 6a2ad8f

Browse files
committed
Fix config loading failure on Windows
1 parent b153e3a commit 6a2ad8f

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
This project adheres to the
44
[Semantic Versioning 2.0 Specification](https://semver.org).
55

6+
## Unreleased
7+
8+
### 🔧 Fixes
9+
10+
- Fix failing to load config on Windows.
11+
612
## 1.0.0 - September 16, 2025
713

814
### ⚠️ Breaking

lib.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import fs from "node:fs/promises";
22
import nodePath from "node:path";
3+
import url from "node:url";
34

45
import chokidar from "chokidar";
56
import { Liquid } from "liquidjs";
@@ -184,7 +185,7 @@ async function tryToImportConfig(path) {
184185
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
185186
/* eslint-disable @typescript-eslint/no-unsafe-return */
186187

187-
const mod = await import(path);
188+
const mod = await import(url.pathToFileURL(path).toString());
188189

189190
if (Object.prototype.toString.call(mod?.default) !== "[object Object]") {
190191
throw new TypeError("config's default export must be an object");

0 commit comments

Comments
 (0)