Skip to content

Commit aef1b55

Browse files
authored
build(ui): normalize dirname for compatibility with the Windows platform (#533)
1 parent 2012f28 commit aef1b55

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/ui/scripts/update-icons.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import { existsSync, readFileSync, writeFileSync } from 'node:fs'
22
import { dirname, resolve } from 'node:path'
3+
import { fileURLToPath } from 'node:url'
34
import { icons } from '@iconify-json/ic'
45
import { devDependencies } from '../package.json'
56

67
const VERSION_COMMENT_RE = /\/\/ Generated from @iconify-json\/ic@(.*)\n/
78

8-
const __dirname = dirname(new URL(import.meta.url).pathname)
9+
const __dirname = dirname(fileURLToPath(new URL(import.meta.url)))
910

1011
const targetPath = resolve(__dirname, '../src/constants/ic-icons.ts')
1112

0 commit comments

Comments
 (0)