Skip to content

Commit 8cf518a

Browse files
authored
fix(cli): corrected the loading of modules on Windows
1 parent ab78f6d commit 8cf518a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/core/src/code-evaluation/rebuildGeometryCli.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import path from 'path'
2+
import url from 'url'
23
import { createRequire } from 'module'
34

45
import { toArray } from '@jscad/array-utils'
@@ -36,7 +37,8 @@ export const rebuildGeometryCli = async (data) => {
3637
// rootModule should contain exported main and getParameterDefinitions functions
3738
// const rootModule = requireDesignFromModule(mainPath, requireFn)
3839
// FIXME HACK for designs with import / export
39-
const rootModule = await import(mainPath)
40+
const mainURL = String(url.pathToFileURL(mainPath))
41+
const rootModule = await import(mainURL)
4042

4143
// the design (module tree) has been loaded at this stage
4244
// now we can get our usefull data (definitions and values/defaults)

0 commit comments

Comments
 (0)