Skip to content

Commit

Permalink
Revert "fix: 🧩 优化路径别名"
Browse files Browse the repository at this point in the history
This reverts commit 8a30a23.
  • Loading branch information
coder-czy committed Dec 19, 2023
1 parent d47ea7d commit e79909f
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 22 deletions.
4 changes: 2 additions & 2 deletions src/components/layouts/components/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import { SizeType } from "antd/es/config-provider/SizeContext";
import { useDispatch, useSelector } from "@/store";
import { updateCollapsed } from "@/store/module/sidebar";
import { setComponentSize, setLanguage } from "@/store/module/global";
import ThemeComp from "@components/layouts/components/Theme";
import FullScreen from "@components/layouts/components/FullScreen";
import ThemeComp from "../Theme";

Check failure on line 20 in src/components/layouts/components/Header/index.tsx

View workflow job for this annotation

GitHub Actions / build-and-deploy

Cannot find module '../Theme' or its corresponding type declarations.
import FullScreen from "../FullScreen";
import SvgIcon from "@/components/svgIcon";

const { Header } = Layout;
Expand Down
2 changes: 2 additions & 0 deletions src/routers/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import React from "react";
import { RouteObject } from "@/routers/type";
import lazyLoad from "@/components/lazyLoad";
import Login from "@/views/login";
// 懒加载组件
// const Login = lazy(() => import('../views/login'))

// 导入其他模块路由
const moduleRoute = import.meta.glob("./modules/*", {
Expand Down
2 changes: 1 addition & 1 deletion src/routers/modules/error.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";

import lazyLoad from "@/components/lazyLoad";
import { RouteObject } from "@routers/type";
import { RouteObject } from "../type";

const errorRoute: RouteObject[] = [
{
Expand Down
2 changes: 1 addition & 1 deletion src/routers/modules/home.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";

import lazyLoad from "@/components/lazyLoad";
import { RouteObject } from "@routers/type";
import { RouteObject } from "../type";
import Layouts from "@/components/layouts";

const homeRoute: RouteObject[] = [
Expand Down
2 changes: 1 addition & 1 deletion src/routers/modules/menu.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";

import { RouteObject } from "@routers/type";
import { RouteObject } from "../type";
import lazyLoad from "@/components/lazyLoad";
import Layouts from "@/components/layouts";

Expand Down
2 changes: 1 addition & 1 deletion src/routers/modules/static.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";

import { RouteObject } from "@routers/type";
import { RouteObject } from "../type";
import lazyLoad from "@/components/lazyLoad";
import Layouts from "@/components/layouts";

Expand Down
2 changes: 1 addition & 1 deletion src/store/module/global.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { PayloadAction, createSlice } from "@reduxjs/toolkit";
import { SizeType } from "antd/es/config-provider/SizeContext";

import { globalType } from "@store/type";
import { globalType } from "../type";

const initialState: globalType = {
token: "",
Expand Down
2 changes: 1 addition & 1 deletion src/store/module/sidebar.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { PayloadAction, createSlice } from "@reduxjs/toolkit";

import { sidebarType } from "@store/type";
import { sidebarType } from "../type";

const initialState: sidebarType = {
isCollapsed: true
Expand Down
14 changes: 4 additions & 10 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,12 @@
"baseUrl": "./",
// 模块名到基于 baseUrl的路径映射的列表。
"paths": {
"@": [
"src"
],
"@/*": [
"src/*"
],
"@routers/*": [
"src/routers/*"
],
"@components/*": [
"src/components/*"
],
"@store/*": [
"src/store/*"
],
]
},
/* Linting */
"strict": true,
Expand Down
5 changes: 1 addition & 4 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ export default defineConfig((mode: ConfigEnv): UserConfig => {
resolve: {
// 路径别名
alias: {
"@": resolve(__dirname, "./src"),
"@components": resolve(__dirname, "./src/components"),
"@routers": resolve(__dirname, "./src/routers"),
"@store": resolve(__dirname, "./src/store")
"@": resolve(__dirname, "./src")
}
},
// 插件配置
Expand Down

0 comments on commit e79909f

Please sign in to comment.