Skip to content

Commit e79909f

Browse files
committed
Revert "fix: 🧩 优化路径别名"
This reverts commit 8a30a23.
1 parent d47ea7d commit e79909f

File tree

10 files changed

+15
-22
lines changed

10 files changed

+15
-22
lines changed

src/components/layouts/components/Header/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ import { SizeType } from "antd/es/config-provider/SizeContext";
1717
import { useDispatch, useSelector } from "@/store";
1818
import { updateCollapsed } from "@/store/module/sidebar";
1919
import { setComponentSize, setLanguage } from "@/store/module/global";
20-
import ThemeComp from "@components/layouts/components/Theme";
21-
import FullScreen from "@components/layouts/components/FullScreen";
20+
import ThemeComp from "../Theme";
21+
import FullScreen from "../FullScreen";
2222
import SvgIcon from "@/components/svgIcon";
2323

2424
const { Header } = Layout;

src/routers/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import React from "react";
55
import { RouteObject } from "@/routers/type";
66
import lazyLoad from "@/components/lazyLoad";
77
import Login from "@/views/login";
8+
// 懒加载组件
9+
// const Login = lazy(() => import('../views/login'))
810

911
// 导入其他模块路由
1012
const moduleRoute = import.meta.glob("./modules/*", {

src/routers/modules/error.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from "react";
22

33
import lazyLoad from "@/components/lazyLoad";
4-
import { RouteObject } from "@routers/type";
4+
import { RouteObject } from "../type";
55

66
const errorRoute: RouteObject[] = [
77
{

src/routers/modules/home.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from "react";
22

33
import lazyLoad from "@/components/lazyLoad";
4-
import { RouteObject } from "@routers/type";
4+
import { RouteObject } from "../type";
55
import Layouts from "@/components/layouts";
66

77
const homeRoute: RouteObject[] = [

src/routers/modules/menu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from "react";
22

3-
import { RouteObject } from "@routers/type";
3+
import { RouteObject } from "../type";
44
import lazyLoad from "@/components/lazyLoad";
55
import Layouts from "@/components/layouts";
66

src/routers/modules/static.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from "react";
22

3-
import { RouteObject } from "@routers/type";
3+
import { RouteObject } from "../type";
44
import lazyLoad from "@/components/lazyLoad";
55
import Layouts from "@/components/layouts";
66

src/store/module/global.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { PayloadAction, createSlice } from "@reduxjs/toolkit";
22
import { SizeType } from "antd/es/config-provider/SizeContext";
33

4-
import { globalType } from "@store/type";
4+
import { globalType } from "../type";
55

66
const initialState: globalType = {
77
token: "",

src/store/module/sidebar.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { PayloadAction, createSlice } from "@reduxjs/toolkit";
22

3-
import { sidebarType } from "@store/type";
3+
import { sidebarType } from "../type";
44

55
const initialState: sidebarType = {
66
isCollapsed: true

tsconfig.json

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,12 @@
2020
"baseUrl": "./",
2121
// 模块名到基于 baseUrl的路径映射的列表。
2222
"paths": {
23+
"@": [
24+
"src"
25+
],
2326
"@/*": [
2427
"src/*"
25-
],
26-
"@routers/*": [
27-
"src/routers/*"
28-
],
29-
"@components/*": [
30-
"src/components/*"
31-
],
32-
"@store/*": [
33-
"src/store/*"
34-
],
28+
]
3529
},
3630
/* Linting */
3731
"strict": true,

vite.config.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@ export default defineConfig((mode: ConfigEnv): UserConfig => {
2525
resolve: {
2626
// 路径别名
2727
alias: {
28-
"@": resolve(__dirname, "./src"),
29-
"@components": resolve(__dirname, "./src/components"),
30-
"@routers": resolve(__dirname, "./src/routers"),
31-
"@store": resolve(__dirname, "./src/store")
28+
"@": resolve(__dirname, "./src")
3229
}
3330
},
3431
// 插件配置

0 commit comments

Comments
 (0)