feat: config dir alias

This commit is contained in:
Anthony Fu committed 2020-08-22 00:12:07 +08:00
1 parent 54f8d25f24
commit 86b3ed348f
7 files changed
+45 -20

No files matched your search

+2 -2
View File
@@ -16,8 +16,8 @@
<script setup lang='ts'>
import { useI18n } from 'vue-i18n'
import { locales } from '../messages'
export { isDark } from '../utils/dark'
import { locales } from '/~/messages'
export { isDark } from '/~/utils'
const i18n = useI18n()
+16
View File
@@ -2,3 +2,19 @@
Routes will auto generated for Vue files in this dir with the same file structure.
Check out [`vite-plugin-voie`](https://github.com/vamplate/vite-plugin-voie) for more details.
### Path Aliasing
You can use `/~/` aliasing to `./src/` folder.
For example, instead of having
```ts
import { locales } from '../../../../messages'
```
now you can use
```ts
import { locales } from '/~/messages'
```
+1
View File
@@ -0,0 +1 @@
export * from './dark'