feat: add alias: ~ -> src

This commit is contained in:
Nex Zhu 2021-12-27 15:06:11 +08:00
parent a7c776a85e
commit 6382f68efd
No known key found for this signature in database
GPG Key ID: 15C6254AD19362B4
5 changed files with 8 additions and 11 deletions

View File

@ -2,10 +2,9 @@
export default {
publicPath: './',
// TODO: `alias` doesn't support TS for now
// alias: {
// '~': 'src',
// },
alias: {
'~': '/src',
},
access: {
roles: {
admin: ['*'],

View File

@ -1,5 +1,5 @@
// .fes.js 只负责管理编译时配置只能使用plain Object
export default {
publicPath: '',
publicPath: './',
}

View File

@ -1,6 +1,6 @@
import { access } from '@fesjs/fes'
import PageLoading from '@/components/PageLoading.vue'
import UserCenter from '@/components/UserCenter.vue'
import PageLoading from '~/components/PageLoading.vue'
import UserCenter from '~/components/UserCenter.vue'
export const beforeRender = {
loading: PageLoading,

View File

@ -4,7 +4,7 @@
<script setup lang="ts">
import { useModel } from '@fesjs/fes'
import type { State } from '@/app'
import type { State } from '~/app'
const initialState = useModel('@@initialState') as State
</script>

View File

@ -4,9 +4,7 @@
"outDir": "build/dist",
"baseUrl": ".",
"paths": {
// TODO: `.fes.js` > `alias` doesn't support TS for now
// "~/*": ["src/*"],
"@/*": ["src/*"],
"~/*": ["src/*"],
"@@/*": ["src/.fes/*"]
}
},