diff --git a/lib/heightBuilder.js b/lib/heightBuilder.js index 7a3d2de20..62574e268 100644 --- a/lib/heightBuilder.js +++ b/lib/heightBuilder.js @@ -6,8 +6,10 @@ import { getJSPageHeight, getWatPageHeight } from "./processor.js"; const config = getConfig(); +const rootDir = new URL("..", import.meta.url); + function getEditorHeights() { - return fse.readJsonSync(config.editorHeights); + return fse.readJsonSync(new URL(config.editorHeights, rootDir)); } /** diff --git a/webpack.config.js b/webpack.config.js index 193a130b3..8a190d4fe 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -19,22 +19,30 @@ export default { ], entry: { "editor-tabbed": { - import: "./editor/js/editor.js", + import: fileURLToPath(new URL("./editor/js/editor.js", import.meta.url)), dependOn: "codemirror", }, "editor-css": { - import: "./editor/js/editable-css.js", + import: fileURLToPath( + new URL("./editor/js/editable-css.js", import.meta.url) + ), dependOn: "codemirror", }, "editor-js": { - import: "./editor/js/editable-js.js", + import: fileURLToPath( + new URL("./editor/js/editable-js.js", import.meta.url) + ), dependOn: "codemirror", }, "editor-wat": { - import: "./editor/js/editable-wat.js", + import: fileURLToPath( + new URL("./editor/js/editable-wat.js", import.meta.url) + ), dependOn: "codemirror", }, - codemirror: "./editor/js/editor-libs/codemirror-editor.js", + codemirror: fileURLToPath( + new URL("./editor/js/editor-libs/codemirror-editor.js", import.meta.url) + ), }, output: { path: fileURLToPath(new URL("docs", import.meta.url)),