Skip to content

Commit 1befc91

Browse files
authored
fix: CLI module imports on windows (#209)
1 parent 5b514fb commit 1befc91

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "fix module imports on windows",
4+
"packageName": "@adaptive-web/adaptive-ui",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}

packages/adaptive-ui/src/bin/aui.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import "./install-dom-shim.js";
22
import path from "path";
33
import fs from "fs";
44
import fsp from "fs/promises";
5+
import { pathToFileURL } from "url";
56
import { matcher } from "matcher"
67
import * as prettier from "prettier";
78
import { ComposableStyles, ElementStyles } from '@microsoft/fast-element';
@@ -119,7 +120,7 @@ async function compileFile(inFilePath: string, outFilePath: string, stylesName:
119120
// Ensure inFile exists
120121
ensureFileExists(inFilePath)
121122

122-
const module = await import(inFilePath);
123+
const module = await import(pathToFileURL(inFilePath).href);
123124
const exportKeys = Object.keys(module);
124125

125126
const stylesExportName = matcher(exportKeys, stylesName);

0 commit comments

Comments
 (0)