From 38bb023903e047196f06f6e9062398cb66f5f2e5 Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Thu, 23 Feb 2023 14:31:43 -0800 Subject: [PATCH] fix: Fix file references (#1116) --- lib/heightBuilder.js | 4 +++- webpack.config.js | 18 +++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) 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)),