fix: vite-plugin-components alias resolving, close #10

This commit is contained in:
Anthony Fu committed 2020-08-26 11:15:08 +08:00
1 parent c6547d4359
commit 7fa1b1556a
3 files changed
+160 -170

No files matched your search

+10 -4
View File
@@ -4,13 +4,19 @@ import Voie from 'vite-plugin-voie'
import PurgeIcons from 'vite-plugin-purge-icons'
import ViteComponents from 'vite-plugin-components'
const alias = {
'/~/': path.resolve(__dirname, 'src'),
}
const config: UserConfig = {
alias: {
'/~/': path.resolve(__dirname, 'src'),
},
alias,
plugins: [
Voie(),
ViteComponents(),
ViteComponents({
// currently, vite does not provide an API for plugins to get the config https://github.com/vitejs/vite/issues/738
// as the `alias` changes the behavior of middlewares, you have to pass it to ViteComponents to do the resolving
alias,
}),
PurgeIcons(),
],
}