Skip to content

Commit

Permalink
fix path import on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
zzcwoshizz committed Jul 12, 2023
1 parent 23740c3 commit b8a0184
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/smart-spoons-shave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@zcloak/dev": patch
---

fix import path on windows
3 changes: 2 additions & 1 deletion packages/dev/scripts/import.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
// SPDX-License-Identifier: Apache-2.0

import path from 'path';
import { pathToFileURL } from 'url';

export function importPath(req) {
return path.join(process.cwd(), 'node_modules', req);
return pathToFileURL(path.join(process.cwd(), 'node_modules', req)).toString();
}

export async function importDirect(bin, req) {
Expand Down

0 comments on commit b8a0184

Please sign in to comment.