mirror of https://gitee.com/lmlz_0/dc-ui.git
fuguobin
9 months ago
7 changed files with 3075 additions and 330 deletions
@ -1,36 +0,0 @@ |
|||||
# dc-ui |
|
||||
|
|
||||
#### Description |
|
||||
{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**} |
|
||||
|
|
||||
#### Software Architecture |
|
||||
Software architecture description |
|
||||
|
|
||||
#### Installation |
|
||||
|
|
||||
1. xxxx |
|
||||
2. xxxx |
|
||||
3. xxxx |
|
||||
|
|
||||
#### Instructions |
|
||||
|
|
||||
1. xxxx |
|
||||
2. xxxx |
|
||||
3. xxxx |
|
||||
|
|
||||
#### Contribution |
|
||||
|
|
||||
1. Fork the repository |
|
||||
2. Create Feat_xxx branch |
|
||||
3. Commit your code |
|
||||
4. Create Pull Request |
|
||||
|
|
||||
|
|
||||
#### Gitee Feature |
|
||||
|
|
||||
1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md |
|
||||
2. Gitee blog [blog.gitee.com](https://blog.gitee.com) |
|
||||
3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) |
|
||||
4. The most valuable open source project [GVP](https://gitee.com/gvp) |
|
||||
5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) |
|
||||
6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) |
|
@ -1,39 +1,16 @@ |
|||||
# dc-ui |
# IoT Management System |
||||
|
|
||||
#### 介绍 |
> IoT 管理系统 |
||||
{**以下是 Gitee 平台说明,您可以替换此简介** |
|
||||
Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台 |
|
||||
无论是个人、团队、或是企业,都能够用 Gitee 实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)} |
|
||||
|
|
||||
#### 软件架构 |
## Build Setup |
||||
软件架构说明 |
|
||||
|
|
||||
|
```bash |
||||
|
# install dependencies |
||||
|
pnpm install |
||||
|
|
||||
#### 安装教程 |
# serve with hot reload at localhost:8080 |
||||
|
pnpm run dev |
||||
|
|
||||
1. xxxx |
# build for production with minification |
||||
2. xxxx |
pnpm run build |
||||
3. xxxx |
``` |
||||
|
|
||||
#### 使用说明 |
|
||||
|
|
||||
1. xxxx |
|
||||
2. xxxx |
|
||||
3. xxxx |
|
||||
|
|
||||
#### 参与贡献 |
|
||||
|
|
||||
1. Fork 本仓库 |
|
||||
2. 新建 Feat_xxx 分支 |
|
||||
3. 提交代码 |
|
||||
4. 新建 Pull Request |
|
||||
|
|
||||
|
|
||||
#### 特技 |
|
||||
|
|
||||
1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md |
|
||||
2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) |
|
||||
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 |
|
||||
4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 |
|
||||
5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) |
|
||||
6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) |
|
||||
|
@ -1,222 +1,227 @@ |
|||||
<!DOCTYPE html> |
<!DOCTYPE html> |
||||
<html> |
<html> |
||||
|
<head> |
||||
|
<meta charset="UTF-8" /> |
||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> |
||||
|
<meta |
||||
|
name="viewport" |
||||
|
content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover" |
||||
|
/> |
||||
|
<meta name="apple-mobile-web-app-capable" content="yes" /> |
||||
|
<meta name="apple-mobile-web-app-status-bar-style" content="black" /> |
||||
|
<meta name="format-detection" content="telphone=no, email=no" /> |
||||
|
<meta name="format-detection" content="telphone=no, email=no" /> |
||||
|
<title>联美运营系统</title> |
||||
|
<link rel="icon" href="" type="image/x-icon" /> |
||||
|
<meta name="apple-mobile-web-app-title" content="联美运营系统" /> |
||||
|
<meta name="keywords" content="联美智慧,联美智科,智慧能源,管理系统" /> |
||||
|
<meta name="description" content="联美运营系统" /> |
||||
|
<meta name="author" content="Daniel" /> |
||||
|
<meta name="copyright" content="联美智慧" /> |
||||
|
<link rel="icon" href="/favicon.ico" type="image/x-icon" /> |
||||
|
<link rel="stylesheet" href="./public/plugins/css/pluginsCss.css" /> |
||||
|
<link rel="stylesheet" href="./public/plugins/plugins.css" /> |
||||
|
<link rel="stylesheet" href="./public/css/luckysheet.css" /> |
||||
|
<link rel="stylesheet" href="./public/assets/iconfont/iconfont.css" /> |
||||
|
<script src="./public/plugins/js/plugin.js"></script> |
||||
|
<script type="module" src="/src/main.ts"></script> |
||||
|
<style> |
||||
|
html, |
||||
|
body, |
||||
|
#app { |
||||
|
height: 100%; |
||||
|
margin: 0px; |
||||
|
padding: 0px; |
||||
|
} |
||||
|
|
||||
<head> |
.chromeframe { |
||||
<meta charset="utf-8"> |
margin: 0.2em 0; |
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
background: #ccc; |
||||
<meta name="renderer" content="webkit"> |
color: #000; |
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> |
padding: 0.2em 0; |
||||
<link rel="icon" href="/favicon.ico"> |
} |
||||
<link rel='stylesheet' href='./public/plugins/css/pluginsCss.css' /> |
|
||||
<link rel='stylesheet' href='./public/plugins/plugins.css' /> |
#loader-wrapper { |
||||
<link rel='stylesheet' href='./public/css/luckysheet.css' /> |
position: fixed; |
||||
<link rel='stylesheet' href='./public/assets/iconfont/iconfont.css' /> |
top: 0; |
||||
<script src="./public/plugins/js/plugin.js" ></script> |
left: 0; |
||||
<!-- rollup luckysheet.js --> |
width: 100%; |
||||
<script src="./public/luckysheet.umd.js" ></script> |
height: 100%; |
||||
<title>联美运营系统</title> |
z-index: 999999; |
||||
<!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]--> |
} |
||||
<style> |
|
||||
html, |
#loader { |
||||
body, |
display: block; |
||||
#app { |
position: relative; |
||||
height: 100%; |
left: 50%; |
||||
margin: 0px; |
top: 50%; |
||||
padding: 0px; |
width: 150px; |
||||
} |
height: 150px; |
||||
|
margin: -75px 0 0 -75px; |
||||
.chromeframe { |
border-radius: 50%; |
||||
margin: 0.2em 0; |
border: 3px solid transparent; |
||||
background: #ccc; |
border-top-color: #fff; |
||||
color: #000; |
-webkit-animation: spin 2s linear infinite; |
||||
padding: 0.2em 0; |
-ms-animation: spin 2s linear infinite; |
||||
} |
-moz-animation: spin 2s linear infinite; |
||||
|
-o-animation: spin 2s linear infinite; |
||||
#loader-wrapper { |
animation: spin 2s linear infinite; |
||||
position: fixed; |
z-index: 1001; |
||||
top: 0; |
} |
||||
left: 0; |
|
||||
width: 100%; |
#loader:before { |
||||
height: 100%; |
content: ""; |
||||
z-index: 999999; |
position: absolute; |
||||
} |
top: 5px; |
||||
|
left: 5px; |
||||
#loader { |
right: 5px; |
||||
display: block; |
bottom: 5px; |
||||
position: relative; |
border-radius: 50%; |
||||
left: 50%; |
border: 3px solid transparent; |
||||
top: 50%; |
border-top-color: #fff; |
||||
width: 150px; |
-webkit-animation: spin 3s linear infinite; |
||||
height: 150px; |
-moz-animation: spin 3s linear infinite; |
||||
margin: -75px 0 0 -75px; |
-o-animation: spin 3s linear infinite; |
||||
border-radius: 50%; |
-ms-animation: spin 3s linear infinite; |
||||
border: 3px solid transparent; |
animation: spin 3s linear infinite; |
||||
border-top-color: #FFF; |
} |
||||
-webkit-animation: spin 2s linear infinite; |
|
||||
-ms-animation: spin 2s linear infinite; |
#loader:after { |
||||
-moz-animation: spin 2s linear infinite; |
content: ""; |
||||
-o-animation: spin 2s linear infinite; |
position: absolute; |
||||
animation: spin 2s linear infinite; |
top: 15px; |
||||
z-index: 1001; |
left: 15px; |
||||
} |
right: 15px; |
||||
|
bottom: 15px; |
||||
#loader:before { |
border-radius: 50%; |
||||
content: ""; |
border: 3px solid transparent; |
||||
position: absolute; |
border-top-color: #fff; |
||||
top: 5px; |
-moz-animation: spin 1.5s linear infinite; |
||||
left: 5px; |
-o-animation: spin 1.5s linear infinite; |
||||
right: 5px; |
-ms-animation: spin 1.5s linear infinite; |
||||
bottom: 5px; |
-webkit-animation: spin 1.5s linear infinite; |
||||
border-radius: 50%; |
animation: spin 1.5s linear infinite; |
||||
border: 3px solid transparent; |
} |
||||
border-top-color: #FFF; |
|
||||
-webkit-animation: spin 3s linear infinite; |
@-webkit-keyframes spin { |
||||
-moz-animation: spin 3s linear infinite; |
0% { |
||||
-o-animation: spin 3s linear infinite; |
-webkit-transform: rotate(0deg); |
||||
-ms-animation: spin 3s linear infinite; |
-ms-transform: rotate(0deg); |
||||
animation: spin 3s linear infinite; |
transform: rotate(0deg); |
||||
} |
} |
||||
|
|
||||
#loader:after { |
100% { |
||||
content: ""; |
-webkit-transform: rotate(360deg); |
||||
position: absolute; |
-ms-transform: rotate(360deg); |
||||
top: 15px; |
transform: rotate(360deg); |
||||
left: 15px; |
} |
||||
right: 15px; |
} |
||||
bottom: 15px; |
|
||||
border-radius: 50%; |
@keyframes spin { |
||||
border: 3px solid transparent; |
0% { |
||||
border-top-color: #FFF; |
-webkit-transform: rotate(0deg); |
||||
-moz-animation: spin 1.5s linear infinite; |
-ms-transform: rotate(0deg); |
||||
-o-animation: spin 1.5s linear infinite; |
transform: rotate(0deg); |
||||
-ms-animation: spin 1.5s linear infinite; |
} |
||||
-webkit-animation: spin 1.5s linear infinite; |
|
||||
animation: spin 1.5s linear infinite; |
100% { |
||||
} |
-webkit-transform: rotate(360deg); |
||||
|
-ms-transform: rotate(360deg); |
||||
|
transform: rotate(360deg); |
||||
@-webkit-keyframes spin { |
} |
||||
0% { |
} |
||||
-webkit-transform: rotate(0deg); |
|
||||
-ms-transform: rotate(0deg); |
#loader-wrapper .loader-section { |
||||
transform: rotate(0deg); |
position: fixed; |
||||
} |
top: 0; |
||||
|
width: 51%; |
||||
100% { |
height: 100%; |
||||
-webkit-transform: rotate(360deg); |
background: #7171c6; |
||||
-ms-transform: rotate(360deg); |
z-index: 1000; |
||||
transform: rotate(360deg); |
-webkit-transform: translateX(0); |
||||
} |
-ms-transform: translateX(0); |
||||
} |
transform: translateX(0); |
||||
|
} |
||||
@keyframes spin { |
|
||||
0% { |
#loader-wrapper .loader-section.section-left { |
||||
-webkit-transform: rotate(0deg); |
left: 0; |
||||
-ms-transform: rotate(0deg); |
} |
||||
transform: rotate(0deg); |
|
||||
} |
|
||||
|
|
||||
100% { |
|
||||
-webkit-transform: rotate(360deg); |
|
||||
-ms-transform: rotate(360deg); |
|
||||
transform: rotate(360deg); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
|
|
||||
#loader-wrapper .loader-section { |
|
||||
position: fixed; |
|
||||
top: 0; |
|
||||
width: 51%; |
|
||||
height: 100%; |
|
||||
background: #7171C6; |
|
||||
z-index: 1000; |
|
||||
-webkit-transform: translateX(0); |
|
||||
-ms-transform: translateX(0); |
|
||||
transform: translateX(0); |
|
||||
} |
|
||||
|
|
||||
#loader-wrapper .loader-section.section-left { |
|
||||
left: 0; |
|
||||
} |
|
||||
|
|
||||
#loader-wrapper .loader-section.section-right { |
|
||||
right: 0; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
.loaded #loader-wrapper .loader-section.section-left { |
|
||||
-webkit-transform: translateX(-100%); |
|
||||
-ms-transform: translateX(-100%); |
|
||||
transform: translateX(-100%); |
|
||||
-webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000); |
|
||||
transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000); |
|
||||
} |
|
||||
|
|
||||
.loaded #loader-wrapper .loader-section.section-right { |
|
||||
-webkit-transform: translateX(100%); |
|
||||
-ms-transform: translateX(100%); |
|
||||
transform: translateX(100%); |
|
||||
-webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000); |
|
||||
transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000); |
|
||||
} |
|
||||
|
|
||||
.loaded #loader { |
|
||||
opacity: 0; |
|
||||
-webkit-transition: all 0.3s ease-out; |
|
||||
transition: all 0.3s ease-out; |
|
||||
} |
|
||||
|
|
||||
.loaded #loader-wrapper { |
|
||||
visibility: hidden; |
|
||||
-webkit-transform: translateY(-100%); |
|
||||
-ms-transform: translateY(-100%); |
|
||||
transform: translateY(-100%); |
|
||||
-webkit-transition: all 0.3s 1s ease-out; |
|
||||
transition: all 0.3s 1s ease-out; |
|
||||
} |
|
||||
|
|
||||
.no-js #loader-wrapper { |
|
||||
display: none; |
|
||||
} |
|
||||
|
|
||||
.no-js h1 { |
|
||||
color: #222222; |
|
||||
} |
|
||||
|
|
||||
#loader-wrapper .load_title { |
|
||||
font-family: 'Open Sans'; |
|
||||
color: #FFF; |
|
||||
font-size: 19px; |
|
||||
width: 100%; |
|
||||
text-align: center; |
|
||||
z-index: 9999999999999; |
|
||||
position: absolute; |
|
||||
top: 60%; |
|
||||
opacity: 1; |
|
||||
line-height: 30px; |
|
||||
} |
|
||||
|
|
||||
#loader-wrapper .load_title span { |
|
||||
font-weight: normal; |
|
||||
font-style: italic; |
|
||||
font-size: 13px; |
|
||||
color: #FFF; |
|
||||
opacity: 0.5; |
|
||||
} |
|
||||
</style> |
|
||||
</head> |
|
||||
|
|
||||
<body> |
|
||||
<div id="app"> |
|
||||
<div id="loader-wrapper"> |
|
||||
<div id="loader"></div> |
|
||||
<div class="loader-section section-left"></div> |
|
||||
<div class="loader-section section-right"></div> |
|
||||
<div class="load_title">正在加载系统资源,请耐心等待</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
<script type="module" src="/src/main.js"></script> |
|
||||
</body> |
|
||||
|
|
||||
</html> |
#loader-wrapper .loader-section.section-right { |
||||
|
right: 0; |
||||
|
} |
||||
|
|
||||
|
.loaded #loader-wrapper .loader-section.section-left { |
||||
|
-webkit-transform: translateX(-100%); |
||||
|
-ms-transform: translateX(-100%); |
||||
|
transform: translateX(-100%); |
||||
|
-webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1); |
||||
|
transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1); |
||||
|
} |
||||
|
|
||||
|
.loaded #loader-wrapper .loader-section.section-right { |
||||
|
-webkit-transform: translateX(100%); |
||||
|
-ms-transform: translateX(100%); |
||||
|
transform: translateX(100%); |
||||
|
-webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1); |
||||
|
transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1); |
||||
|
} |
||||
|
|
||||
|
.loaded #loader { |
||||
|
opacity: 0; |
||||
|
-webkit-transition: all 0.3s ease-out; |
||||
|
transition: all 0.3s ease-out; |
||||
|
} |
||||
|
|
||||
|
.loaded #loader-wrapper { |
||||
|
visibility: hidden; |
||||
|
-webkit-transform: translateY(-100%); |
||||
|
-ms-transform: translateY(-100%); |
||||
|
transform: translateY(-100%); |
||||
|
-webkit-transition: all 0.3s 1s ease-out; |
||||
|
transition: all 0.3s 1s ease-out; |
||||
|
} |
||||
|
|
||||
|
.no-js #loader-wrapper { |
||||
|
display: none; |
||||
|
} |
||||
|
|
||||
|
.no-js h1 { |
||||
|
color: #222222; |
||||
|
} |
||||
|
|
||||
|
#loader-wrapper .load_title { |
||||
|
font-family: "Open Sans"; |
||||
|
color: #fff; |
||||
|
font-size: 19px; |
||||
|
width: 100%; |
||||
|
text-align: center; |
||||
|
z-index: 9999999999999; |
||||
|
position: absolute; |
||||
|
top: 60%; |
||||
|
opacity: 1; |
||||
|
line-height: 30px; |
||||
|
} |
||||
|
|
||||
|
#loader-wrapper .load_title span { |
||||
|
font-weight: normal; |
||||
|
font-style: italic; |
||||
|
font-size: 13px; |
||||
|
color: #fff; |
||||
|
opacity: 0.5; |
||||
|
} |
||||
|
</style> |
||||
|
</head> |
||||
|
|
||||
|
<body> |
||||
|
<div id="app"> |
||||
|
<div id="loader-wrapper"> |
||||
|
<div id="loader"></div> |
||||
|
<div class="loader-section section-left"></div> |
||||
|
<div class="loader-section section-right"></div> |
||||
|
<div class="load_title">正在加载系统资源,请耐心等待</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<script type="module" src="/src/main.js"></script> |
||||
|
</body> |
||||
|
</html> |
||||
|
File diff suppressed because it is too large
@ -1,68 +1,109 @@ |
|||||
import { defineConfig, loadEnv } from 'vite' |
import { defineConfig, loadEnv } from "vite"; |
||||
import path from 'path' |
import path from "path"; |
||||
import createVitePlugins from './vite/plugins' |
import createVitePlugins from "./vite/plugins"; |
||||
|
|
||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||
export default defineConfig(({ mode, command }) => { |
export default defineConfig(({ mode, command }) => { |
||||
const env = loadEnv(mode, process.cwd()) |
const env = loadEnv(mode, process.cwd()); |
||||
const { VITE_APP_ENV } = env |
const { VITE_APP_ENV } = env; |
||||
return { |
return { |
||||
// 部署生产环境和开发环境下的URL。
|
// 部署生产环境和开发环境下的URL。
|
||||
// 默认情况下,vite 会假设你的应用是被部署在一个域名的根路径上
|
// 默认情况下,vite 会假设你的应用是被部署在一个域名的根路径上
|
||||
// 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
|
// 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
|
||||
base: VITE_APP_ENV === 'production' ? '/' : '/', |
base: VITE_APP_ENV === "production" ? "/" : "/", |
||||
plugins: createVitePlugins(env, command === 'build'), |
plugins: createVitePlugins(env, command === "build"), |
||||
resolve: { |
resolve: { |
||||
// https://cn.vitejs.dev/config/#resolve-alias
|
// https://cn.vitejs.dev/config/#resolve-alias
|
||||
alias: { |
alias: { |
||||
// 设置路径
|
// 设置路径
|
||||
'~': path.resolve(__dirname, './'), |
"~": path.resolve(__dirname, "./"), |
||||
// 设置别名
|
// 设置别名
|
||||
'/@': path.resolve(__dirname, './src'), |
"/@": path.resolve(__dirname, "./src"), |
||||
'@': path.resolve(__dirname, './src'), |
"@": path.resolve(__dirname, "./src"), |
||||
}, |
}, |
||||
// https://cn.vitejs.dev/config/#resolve-extensions
|
// https://cn.vitejs.dev/config/#resolve-extensions
|
||||
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue'] |
extensions: [".mjs", ".js", ".ts", ".jsx", ".tsx", ".json", ".vue"], |
||||
}, |
}, |
||||
optimizeDeps: { |
optimizeDeps: { |
||||
include: ['@/components/vform/designer.umd.js'] //此处路径必须跟main.js中import路径完全一致!
|
include: ["@/components/vform/designer.umd.js"], //此处路径必须跟main.js中import路径完全一致!
|
||||
}, |
}, |
||||
|
//本地运行配置,以及反向代理配置
|
||||
build: { |
|
||||
commonjsOptions: { |
|
||||
include: /node_modules|src|components/ |
|
||||
} |
|
||||
}, |
|
||||
// vite 相关配置
|
|
||||
server: { |
server: { |
||||
port: 8010, |
host: "localhost", |
||||
host: true, |
https: false, //是否启用 http 2
|
||||
open: true |
cors: true, //为开发服务器配置 CORS , 默认启用并允许任何源
|
||||
// proxy: {
|
open: true, //服务启动时自动在浏览器中打开应用
|
||||
// // https://cn.vitejs.dev/config/#server-proxy
|
port: Number(env.VITE_APP_PORT), |
||||
// '/dev-api': {
|
strictPort: false, //设为true时端口被占用则直接退出,不会尝试下一个可用端口
|
||||
// target: 'http://localhost:8080',
|
force: false, //是否强制依赖预构建
|
||||
// changeOrigin: true,
|
hmr: true, //配置HMR
|
||||
// rewrite: (p) => p.replace(/^\/dev-api/, '')
|
proxy: { |
||||
// }
|
"/dev-api": { |
||||
// }
|
// target: 'http://172.1.2.76:9010/', //本地接口地址
|
||||
|
// target: 'http://172.1.2.90:9010/', //本地接口地址
|
||||
|
target: "http://10.10.10.56:9010/", //线上测试接口地址
|
||||
|
changeOrigin: true, |
||||
|
rewrite: (path) => path.replace(/^\/dev-api/, ""), |
||||
|
}, |
||||
|
}, |
||||
}, |
}, |
||||
//fix:error:stdin>:7356:1: warning: "@charset" must be the first rule in the file
|
//fix:error:stdin>:7356:1: warning: "@charset" must be the first rule in the file
|
||||
css: { |
css: { |
||||
postcss: { |
postcss: { |
||||
plugins: [ |
plugins: [ |
||||
{ |
{ |
||||
postcssPlugin: 'internal:charset-removal', |
postcssPlugin: "internal:charset-removal", |
||||
AtRule: { |
AtRule: { |
||||
charset: (atRule) => { |
charset: (atRule) => { |
||||
if (atRule.name === 'charset') { |
if (atRule.name === "charset") { |
||||
atRule.remove(); |
atRule.remove(); |
||||
} |
} |
||||
} |
}, |
||||
} |
}, |
||||
} |
}, |
||||
] |
], |
||||
} |
}, |
||||
} |
}, |
||||
} |
//打包配置
|
||||
}) |
build: { |
||||
|
//浏览器兼容性 "esnext"|"modules"
|
||||
|
target: "modules", |
||||
|
//指定输出路径
|
||||
|
outDir: "dist", |
||||
|
//生成静态资源的存放路径
|
||||
|
assetsDir: "assets", |
||||
|
//小于此阈值的导入或引用资源将内联为 base64 编码,以避免额外的 http 请求。设置为 0 可以完全禁用此项
|
||||
|
assetsInlineLimit: 4096, |
||||
|
//启用/禁用 CSS 代码拆分
|
||||
|
cssCodeSplit: true, |
||||
|
//构建后是否生成 source map 文件
|
||||
|
sourcemap: false, |
||||
|
//自定义底层的 Rollup 打包配置
|
||||
|
rollupOptions: {}, |
||||
|
//@rollup/plugin-commonjs 插件的选项
|
||||
|
commonjsOptions: { |
||||
|
include: /node_modules|src|components/, |
||||
|
}, |
||||
|
//当设置为 true,构建后将会生成 manifest.json 文件
|
||||
|
manifest: false, |
||||
|
// 设置为 false 可以禁用最小化混淆,
|
||||
|
// 或是用来指定使用哪种混淆器
|
||||
|
// boolean | 'terser' | 'esbuild'
|
||||
|
minify: "terser", //terser 构建后文件体积更小
|
||||
|
//传递给 Terser 的更多 minify 选项。
|
||||
|
terserOptions: { |
||||
|
compress: { |
||||
|
//生产环境时移除console
|
||||
|
drop_console: true, |
||||
|
drop_debugger: true, |
||||
|
}, |
||||
|
}, |
||||
|
//设置为 false 来禁用将构建后的文件写入磁盘
|
||||
|
write: true, |
||||
|
//默认情况下,若 outDir 在 root 目录下,则 Vite 会在构建时清空该目录。
|
||||
|
emptyOutDir: true, |
||||
|
//chunk 大小警告的限制
|
||||
|
chunkSizeWarningLimit: 500, |
||||
|
}, |
||||
|
}; |
||||
|
}); |
||||
|
Loading…
Reference in new issue