Skip to content

Commit

Permalink
feat: ✨ 修改VITE配置
Browse files Browse the repository at this point in the history
  • Loading branch information
G committed Jan 2, 2024
1 parent c332d69 commit 1b57ebf
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 11 deletions.
8 changes: 8 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,11 @@ antd5已经发布很久了,之前一直在维护的一套基于antd4版本的
```bash
npx @chenshuai2144/less2cssinjs less2js -i src
```

##

<a href="https://github.com/anyone-yuren/react-antd-admin-pnpm/graphs/contributors">
<img src="https://contrib.rocks/image?repo=anyone-yuren/react-antd-admin-pnpm" />
</a>

欢迎 PR,您可以直接找我讨论,QQ: 1003473088,如果这是一个很大的变化!
6 changes: 5 additions & 1 deletion apps/admin/.env.development
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
VITE_APP_BASE_API:
VITE_APP_BASE_API:

VITE_APP_BASE_URL: './'

VITE_PORT: 3100
4 changes: 3 additions & 1 deletion apps/admin/.env.production
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
VITE_APP_BASE_API:
VITE_APP_BASE_API:

VITE_APP_BASE_URL: '/react-antd-admin-pnpm/'
6 changes: 3 additions & 3 deletions apps/admin/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ function App() {
}}
>
<CustomGlobal />
{/* {loading ? <LoadingPage /> : <RouterProvider router={router} />} */}
{loading ? (
{loading ? <LoadingPage /> : <RouterProvider router={router} />}
{/* {loading ? (
<LoadingPage />
) : (
<HashRouter>
<Router />
</HashRouter>
)}
)} */}
</ThemeProvider>
</GlobalConfig>
);
Expand Down
5 changes: 1 addition & 4 deletions apps/admin/src/layout/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Layout } from 'antd';
import ErrorBoundary from 'antd/es/alert/ErrorBoundary';
import { Suspense } from 'react';
import { Outlet } from 'react-router-dom';

import { AppLogo } from '@/components/AppLogo';
Expand Down Expand Up @@ -30,9 +29,7 @@ export const BasicLayout = (props: any) => {
<LayoutHeader />
<Content>
<ErrorBoundary>
<Suspense fallback={' loading'}>
<Outlet />
</Suspense>
<Outlet />
</ErrorBoundary>
</Content>
</Layout>
Expand Down
4 changes: 2 additions & 2 deletions apps/admin/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {

// this function can be converted to different typings
const viteEnv: any = wrapperEnv(env);
const { VITE_PORT, VITE_DROP_CONSOLE } = viteEnv;
const { VITE_PORT, VITE_DROP_CONSOLE, VITE_APP_BASE_URL } = viteEnv;

return {
base: isBuild ? '/react-antd-admin-pnpm/' : './',
base: VITE_APP_BASE_URL,
server: {
// Listening on all local ips
host: true,
Expand Down

0 comments on commit 1b57ebf

Please sign in to comment.