Skip to content

Commit

Permalink
chore: remove lodash and change packag e type to module
Browse files Browse the repository at this point in the history
  • Loading branch information
kingyue737 committed Sep 26, 2023
1 parent baefdc3 commit acda877
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"private": true,
"type": "module",
"packageManager": "[email protected]",
"scripts": {
"dev": "vite --open --host",
Expand Down
17 changes: 10 additions & 7 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, string> = {}
Object.keys(mdicons).forEach((key) => {
const value = (mdicons as Record<string, string>)[key]
mdi[
key.replace(
/[A-Z]+(?![a-z])|[A-Z0-9]/g,
($, ofs) => (ofs ? '-' : '') + $.toLowerCase(),
)
] = value
})

// https://vitejs.dev/config/
export default defineConfig({
Expand Down

0 comments on commit acda877

Please sign in to comment.