2020-08-22 00:12:07 +08:00
|
|
|
import path from 'path'
|
2020-08-21 00:32:38 +08:00
|
|
|
import { UserConfig } from 'vite'
|
2020-08-15 00:58:50 +08:00
|
|
|
import Voie from 'vite-plugin-voie'
|
2020-08-10 19:24:52 +08:00
|
|
|
import PurgeIcons from 'vite-plugin-purge-icons'
|
2020-08-21 04:53:46 +08:00
|
|
|
import ViteComponents from 'vite-plugin-components'
|
2020-08-10 02:43:04 +08:00
|
|
|
|
2020-08-26 11:15:08 +08:00
|
|
|
const alias = {
|
|
|
|
'/~/': path.resolve(__dirname, 'src'),
|
|
|
|
}
|
|
|
|
|
2020-08-21 00:32:38 +08:00
|
|
|
const config: UserConfig = {
|
2020-08-26 11:15:08 +08:00
|
|
|
alias,
|
2020-08-10 02:43:04 +08:00
|
|
|
plugins: [
|
2020-08-20 16:04:00 +08:00
|
|
|
Voie(),
|
2020-08-26 11:15:08 +08:00
|
|
|
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,
|
|
|
|
}),
|
2020-08-10 19:24:52 +08:00
|
|
|
PurgeIcons(),
|
2020-08-10 02:43:04 +08:00
|
|
|
],
|
|
|
|
}
|
2020-08-21 00:32:38 +08:00
|
|
|
|
|
|
|
export default config
|