Skip to content
This repository was archived by the owner on Jun 27, 2023. It is now read-only.

Commit 680e9f7

Browse files
committed
deps: updated vite plugins to unplugin
1 parent bd17e4e commit 680e9f7

File tree

4 files changed

+3189
-2456
lines changed

4 files changed

+3189
-2456
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@
5858
"deep-object-diff": "^1.1.7"
5959
},
6060
"devDependencies": {
61-
"@tailwindcss/typography": "^0.5.1",
6261
"@asigloo/prettier-config": "^0.2.0",
6362
"@cypress/vite-dev-server": "^2.2.2",
6463
"@iconify/json": "^2.0.34",
6564
"@microsoft/api-extractor": "^7.19.4",
65+
"@tailwindcss/typography": "^0.5.1",
6666
"@types/jest": "^27.4.0",
6767
"@typescript-eslint/eslint-plugin": "^5.10.2",
6868
"@typescript-eslint/parser": "^5.10.2",
@@ -97,9 +97,9 @@
9797
"ts-jest": "^27.1.3",
9898
"ts-node": "^10.4.0",
9999
"typescript": "~4.5.5",
100+
"unplugin-icons": "^0.13.0",
101+
"unplugin-vue-components": "^0.17.17",
100102
"vite": "^2.7.13",
101-
"vite-plugin-components": "^0.13.3",
102-
"vite-plugin-icons": "^0.6.5",
103103
"vite-plugin-pwa": "^0.11.13",
104104
"vitepress": "^0.21.6",
105105
"vue": "^3.2.30",

src/components.d.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// generated by unplugin-vue-components
2+
// We suggest you to commit this file into source control
3+
// Read more: https://github.com/vuejs/vue-next/pull/3399
4+
5+
declare module 'vue' {
6+
export interface GlobalComponents {
7+
CheckboxInput: typeof import('./components/checkbox-input/CheckboxInput.vue')['default']
8+
CodiconGithub: typeof import('~icons/codicon/github')['default']
9+
Console: typeof import('./../demos/vue-3/src/components/Console.vue')['default']
10+
DynamicForm: typeof import('./components/dynamic-form/DynamicForm.vue')['default']
11+
DynamicInput: typeof import('./components/dynamic-input/DynamicInput.vue')['default']
12+
IonDocumentTextOutline: typeof import('~icons/ion/document-text-outline')['default']
13+
NumberInput: typeof import('./components/number-input/NumberInput.vue')['default']
14+
RadioInput: typeof import('./components/radio-input/RadioInput.vue')['default']
15+
SelectInput: typeof import('./components/select-input/SelectInput.vue')['default']
16+
TextAreaInput: typeof import('./components/text-area-input/TextAreaInput.vue')['default']
17+
TextInput: typeof import('./components/text-input/TextInput.vue')['default']
18+
Toolbar: typeof import('./../demos/vue-3/src/components/Toolbar.vue')['default']
19+
}
20+
}
21+
22+
export { }

vite.config.ts

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { defineConfig } from 'vite';
2-
import vue from '@vitejs/plugin-vue';
3-
import ViteComponents from 'vite-plugin-components';
1+
import { defineConfig } from 'vite'
2+
import vue from '@vitejs/plugin-vue'
3+
import Components from 'unplugin-vue-components/vite'
4+
import Icons from 'unplugin-icons/vite'
5+
import IconsResolver from 'unplugin-icons/resolver'
46

5-
import ViteIcons, { ViteIconsResolver } from 'vite-plugin-icons';
6-
7-
const { resolve } = require('path');
7+
const { resolve } = require('path')
88

99
// https://vitejs.dev/config/
1010
export default defineConfig({
@@ -15,12 +15,28 @@ export default defineConfig({
1515
},
1616
plugins: [
1717
vue(),
18-
ViteComponents({
19-
dirs: ['src/components', 'demos/vue-3/src/components'],
20-
customComponentResolvers: ViteIconsResolver({
21-
componentPrefix: '', // <--
22-
}),
18+
Components({
19+
// allow auto load markdown components under `./src/components/`
20+
extensions: ['vue', 'md'],
21+
22+
// allow auto import and register components used in markdown
23+
include: [/\.vue$/, /\.vue\?vue/, /\.md$/],
24+
dirs: ['./src/components', 'demos/vue-3/src/components'],
25+
26+
// custom resolvers
27+
resolvers: [
28+
// auto import icons
29+
// https://github.com/antfu/unplugin-icons
30+
IconsResolver({
31+
prefix: false,
32+
// enabledCollections: ['carbon']
33+
}),
34+
],
35+
36+
dts: 'src/components.d.ts',
37+
}),
38+
Icons({
39+
autoInstall: true,
2340
}),
24-
ViteIcons({}),
2541
],
26-
});
42+
})

0 commit comments

Comments
 (0)