fix: replace ES module imports with JSON data files
Extract SVG map data from @svg-maps packages into plain JSON files to avoid ES module loading issues in Node.js server context. This eliminates the "Unexpected token 'export'" error by removing dependency on ES module packages entirely. The data is now committed directly in the repo as JSON. Changes: - Extract @svg-maps/world and @svg-maps/usa data to JSON files - Update maps.ts to import from local JSON files instead of npm packages - Remove reliance on ES module imports in server-side code 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
9f48420ba4
commit
fb735be014
|
|
@ -59,7 +59,8 @@
|
|||
"Bash(pnpm install:*)",
|
||||
"Bash(git checkout:*)",
|
||||
"Bash(node server.js:*)",
|
||||
"Bash(git fetch:*)"
|
||||
"Bash(git fetch:*)",
|
||||
"Bash(cat:*)"
|
||||
],
|
||||
"deny": [],
|
||||
"ask": []
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,7 +1,11 @@
|
|||
import World from '@svg-maps/world'
|
||||
import USA from '@svg-maps/usa'
|
||||
import WorldData from './data/world.json'
|
||||
import USAData from './data/usa.json'
|
||||
import type { MapData, MapRegion } from './types'
|
||||
|
||||
// Type the imported JSON data
|
||||
const World = WorldData as { label: string; viewBox: string; locations: Array<{ id: string; name: string; path: string }> }
|
||||
const USA = USAData as { label: string; viewBox: string; locations: Array<{ id: string; name: string; path: string }> }
|
||||
|
||||
/**
|
||||
* Difficulty level configuration for a map
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue