Skip to content

Commit

Permalink
feat(ts config): add baseUrl and paths
Browse files Browse the repository at this point in the history
避免ts文件中使用 @ 别名时报错
  • Loading branch information
knight174 committed Aug 17, 2023
1 parent 87255fe commit 7452d89
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { createApp } from 'vue'
import App from './App.vue'

import './style/reset.css'
import router from './router/index'
import router from '@/router/index'
import store from './store/index'

createApp(App).use(router).use(store).mount('#app')
4 changes: 4 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
},
"target": "esnext",
"useDefineForClassFields": true,
"module": "esnext",
Expand Down

0 comments on commit 7452d89

Please sign in to comment.