feat: config dir alias
This commit is contained in:
1 parent
54f8d25f24
commit
86b3ed348f
7 files changed
+45
-20
No files matched your search
@@ -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()
|
||||
|
||||
|
||||
@@ -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'
|
||||
```
|
||||
@@ -0,0 +1 @@
|
||||
export * from './dark'
|
||||
Reference in new issue
Block a user