File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import type { NextConfig } from "next" ;
2+ import path from "path" ;
23
34const 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
Original file line number Diff line number Diff 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} ;
You can’t perform that action at this time.
0 commit comments