|
@@ -38,19 +38,16 @@ pnpm preview
|
|
|
|
|
|
```bash
|
|
```bash
|
|
npm i -g live-server
|
|
npm i -g live-server
|
|
-
|
|
|
|
```
|
|
```
|
|
|
|
|
|
然后在 `dist` 目录下执行 `live-server` 命令,即可在本地查看效果。
|
|
然后在 `dist` 目录下执行 `live-server` 命令,即可在本地查看效果。
|
|
|
|
|
|
```bash
|
|
```bash
|
|
-
|
|
|
|
cd apps/web-antd/dist
|
|
cd apps/web-antd/dist
|
|
# 本地预览,默认端口8080
|
|
# 本地预览,默认端口8080
|
|
live-server
|
|
live-server
|
|
# 指定端口
|
|
# 指定端口
|
|
live-server --port 9000
|
|
live-server --port 9000
|
|
-
|
|
|
|
```
|
|
```
|
|
|
|
|
|
## 压缩
|
|
## 压缩
|
|
@@ -61,7 +58,6 @@ live-server --port 9000
|
|
|
|
|
|
```bash
|
|
```bash
|
|
VITE_COMPRESS=gzip
|
|
VITE_COMPRESS=gzip
|
|
-
|
|
|
|
```
|
|
```
|
|
|
|
|
|
### 开启 `brotli` 压缩
|
|
### 开启 `brotli` 压缩
|
|
@@ -70,7 +66,6 @@ VITE_COMPRESS=gzip
|
|
|
|
|
|
```bash
|
|
```bash
|
|
VITE_COMPRESS=brotli
|
|
VITE_COMPRESS=brotli
|
|
-
|
|
|
|
```
|
|
```
|
|
|
|
|
|
### 同时开启 `gzip` 和 `brotli` 压缩
|
|
### 同时开启 `gzip` 和 `brotli` 压缩
|
|
@@ -79,7 +74,6 @@ VITE_COMPRESS=brotli
|
|
|
|
|
|
```bash
|
|
```bash
|
|
VITE_COMPRESS=gzip,brotli
|
|
VITE_COMPRESS=gzip,brotli
|
|
-
|
|
|
|
```
|
|
```
|
|
|
|
|
|
::: tip 提示
|
|
::: tip 提示
|
|
@@ -173,7 +167,6 @@ VITE_BASE=/xxx/
|
|
|
|
|
|
```bash
|
|
```bash
|
|
VITE_ROUTER_HISTORY=hash
|
|
VITE_ROUTER_HISTORY=hash
|
|
-
|
|
|
|
```
|
|
```
|
|
|
|
|
|
### history 路由模式下服务端配置
|
|
### history 路由模式下服务端配置
|
|
@@ -215,7 +208,6 @@ server {
|
|
try_files $uri $uri/ /sub/index.html;
|
|
try_files $uri $uri/ /sub/index.html;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
```
|
|
```
|
|
|
|
|
|
## 跨域处理
|
|
## 跨域处理
|