Skip to content

Commit

Permalink
fix: CLI module imports on windows (#209)
Browse files Browse the repository at this point in the history
  • Loading branch information
KingOfTac authored Aug 23, 2024
1 parent 5b514fb commit 1befc91
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "fix module imports on windows",
"packageName": "@adaptive-web/adaptive-ui",
"email": "32497422+KingOfTac@users.noreply.github.com",
"dependentChangeType": "patch"
}
3 changes: 2 additions & 1 deletion packages/adaptive-ui/src/bin/aui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import "./install-dom-shim.js";
import path from "path";
import fs from "fs";
import fsp from "fs/promises";
import { pathToFileURL } from "url";
import { matcher } from "matcher"
import * as prettier from "prettier";
import { ComposableStyles, ElementStyles } from '@microsoft/fast-element';
Expand Down Expand Up @@ -119,7 +120,7 @@ async function compileFile(inFilePath: string, outFilePath: string, stylesName:
// Ensure inFile exists
ensureFileExists(inFilePath)

const module = await import(inFilePath);
const module = await import(pathToFileURL(inFilePath).href);
const exportKeys = Object.keys(module);

const stylesExportName = matcher(exportKeys, stylesName);
Expand Down

0 comments on commit 1befc91

Please sign in to comment.