mirror of
https://github.com/netbymatt/nexrad-level-3-data.git
synced 2026-11-28 10:58:04 -08:00
adjust for windows/linux paths during dynamic import
This commit is contained in:
2 files changed
+4
-2
No files matched your search
@@ -1,5 +1,6 @@
|
||||
import fs from 'node:fs/promises';
|
||||
import path from 'node:path';
|
||||
import { pathToFileURL } from 'node:url';
|
||||
|
||||
// load all packets in folder automatically
|
||||
|
||||
@@ -8,7 +9,7 @@ const filesChecked = await Promise.all(filesRaw.map(async (file) => !(await fs.l
|
||||
const files = filesRaw.filter((_, i) => filesChecked[i]);
|
||||
|
||||
const packetsRaw = await Promise.all(
|
||||
files.map((file) => import(path.join(import.meta.dirname, file))),
|
||||
files.map((file) => import(pathToFileURL(path.join(import.meta.dirname, file)))),
|
||||
);
|
||||
|
||||
// make up a list of packets by integer type
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import fs from 'node:fs/promises';
|
||||
import path from 'node:path';
|
||||
import { pathToFileURL } from 'node:url';
|
||||
|
||||
// load all products in folder automatically
|
||||
|
||||
@@ -8,7 +9,7 @@ const foldersChecked = await Promise.all(foldersRaw.map(async (folder) => (await
|
||||
const folders = foldersRaw.filter((_, i) => foldersChecked[i]);
|
||||
|
||||
const productsRaw = await Promise.all(
|
||||
folders.map((folder) => import(path.join(import.meta.dirname, folder, 'index.mjs'))),
|
||||
folders.map((folder) => import(pathToFileURL(path.join(import.meta.dirname, folder, 'index.mjs')))),
|
||||
);
|
||||
|
||||
// make up a list of products by integer type
|
||||
|
||||
Reference in new issue
Block a user