diff --git a/package.json b/package.json index 53f5e04..78f2340 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,6 @@ { "private": true, + "type": "module", "packageManager": "pnpm@8.7.6", "scripts": { "dev": "vite --open --host", diff --git a/vite.config.ts b/vite.config.ts index 58a336f..14b2112 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -13,14 +13,17 @@ import VueI18n from '@intlify/unplugin-vue-i18n/vite' import browserslistToEsbuild from 'browserslist-to-esbuild' import Modify from '@kingyue/rollup-plugin-modify' import * as mdicons from '@mdi/js' -import { mapKeys } from 'lodash' -const mdi = mapKeys(mdicons, (v, k) => - k.replace( - /[A-Z]+(?![a-z])|[A-Z0-9]/g, - ($, ofs) => (ofs ? '-' : '') + $.toLowerCase(), - ), -) +const mdi: Record = {} +Object.keys(mdicons).forEach((key) => { + const value = (mdicons as Record)[key] + mdi[ + key.replace( + /[A-Z]+(?![a-z])|[A-Z0-9]/g, + ($, ofs) => (ofs ? '-' : '') + $.toLowerCase(), + ) + ] = value +}) // https://vitejs.dev/config/ export default defineConfig({