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 { export default {
publicPath: './', publicPath: './',
// TODO: `alias` doesn't support TS for now alias: {
// alias: { '~': '/src',
// '~': 'src', },
// },
access: { access: {
roles: { roles: {
admin: ['*'], admin: ['*'],

View File

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

View File

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

View File

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

View File

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