Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/core/src/code-evaluation/rebuildGeometryCli.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import path from 'path'
import url from 'url'
import { createRequire } from 'module'

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

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