« get me outta code hell

infra: attempt to make content function imports work on windows - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-08-13 15:37:17 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-08-13 15:37:47 -0300
commite587d189f76cb537628bed0f3cde08625032ee16 (patch)
treecedda06193af041f88118c204f1234420298e37b /src/content/dependencies
parent82036040f70ab9d5b30afe372bcd43061acff5d8 (diff)
infra: attempt to make content function imports work on windows
Diffstat (limited to 'src/content/dependencies')
-rw-r--r--src/content/dependencies/index.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/content/dependencies/index.js b/src/content/dependencies/index.js
index 36cd27fc..4f7c5244 100644
--- a/src/content/dependencies/index.js
+++ b/src/content/dependencies/index.js
@@ -160,7 +160,13 @@ export function watchContentDependencies({
 
       let spec;
       try {
-        spec = (await import(cachebust(filePath))).default;
+        const module =
+          await import(
+            cachebust(
+              '.' +
+              path.sep +
+              path.relative(metaDirname, filePath)));
+        spec = module.default;
       } catch (caughtError) {
         error = caughtError;
         error.message = `Error importing: ${error.message}`;