chore: update vitest config to support loading icons

This commit is contained in:
Andrew Bastin
2023-07-04 12:52:26 +05:30
parent 6fe565c30f
commit 0d101673d2

View File

@@ -1,5 +1,7 @@
import { defineConfig } from "vitest/config"
import * as path from "path"
import Icons from "unplugin-icons/vite"
import { FileSystemIconLoader } from "unplugin-icons/loaders"
export default defineConfig({
test: {
@@ -9,6 +11,22 @@ export default defineConfig({
resolve: {
alias: {
"~": path.resolve(__dirname, "../hoppscotch-common/src"),
"@composables": path.resolve(
__dirname,
"../hoppscotch-common/src/composables"
),
},
},
plugins: [
Icons({
compiler: "vue3",
customCollections: {
hopp: FileSystemIconLoader("../hoppscotch-common/assets/icons"),
auth: FileSystemIconLoader("../hoppscotch-common/assets/icons/auth"),
brands: FileSystemIconLoader(
"../hoppscotch-common/assets/icons/brands"
),
},
}) as any,
],
})