Skip to content

Commit

Permalink
fix import path generation
Browse files Browse the repository at this point in the history
  • Loading branch information
0xa3k5 committed Aug 17, 2024
1 parent bbe4653 commit 31e35b2
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,23 @@ export function generateMapping() {
.filter((file) => file.endsWith('.tsx'))
.map((file) => {
const iconName = path.basename(file, '.tsx')
return `${iconName}: () => import('./icons/networks/${iconName}'),\n`
return `${iconName}: () => import('../icons/networks/${iconName}'),\n`
})
.join('')

const tokenPaths = tokenIcons
.filter((file) => file.endsWith('.tsx'))
.map((file) => {
const iconName = path.basename(file, '.tsx')
return `${iconName}: () => import('./icons/tokens/${iconName}'),\n`
return `${iconName}: () => import('../icons/tokens/${iconName}'),\n`
})
.join('')

const walletPaths = walletIcons
.filter((file) => file.endsWith('.tsx'))
.map((file) => {
const iconName = path.basename(file, '.tsx')
return `${iconName}: () => import('./icons/wallets/${iconName}'),\n`
return `${iconName}: () => import('../icons/wallets/${iconName}'),\n`
})
.join('')

Expand All @@ -49,5 +49,5 @@ export const WALLET_ICON_IMPORT_MAP: IconImportMap = {\n${walletPaths}};\n

const outputPath = path.join(ROOT_REACT, 'src/utils/icon-import-map.ts')
fs.writeFileSync(outputPath, content)
console.log('✅ import paths has been generated at:', outputPath)
console.log('✅ generated: import paths at:', outputPath)
}

0 comments on commit 31e35b2

Please sign in to comment.