Skip to content

Commit a70076a

Browse files
committed
Squashed dev into main, keeping dev changes
1 parent fc389c9 commit a70076a

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

next.config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { NextConfig } from "next";
2+
import path from "path";
23

34
const nextConfig: NextConfig = {
45
/* config options here */
@@ -11,6 +12,10 @@ const nextConfig: NextConfig = {
1112
},
1213
],
1314
},
15+
webpack: (config) => {
16+
config.resolve.alias["@data"] = path.join(__dirname, "src/app/data");
17+
return config;
18+
},
1419
devIndicators: false,
1520
};
1621

src/app/worker/LoadData.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ onmessage = async (event) => {
22
const { type } = event.data;
33

44
try {
5-
const module = await import(`@data/${type}.json`);
6-
postMessage({ type, data: module.default });
7-
} catch (err) {
5+
const importedModule = await import(`@data/${type}.json`);
6+
postMessage({ type, data: importedModule.default });
7+
} catch {
88
postMessage({ type, data: [] });
99
}
1010
};

0 commit comments

Comments
 (0)