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 |
|||
|
|||
#### 介绍 |
|||
{**以下是 Gitee 平台说明,您可以替换此简介** |
|||
Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台 |
|||
无论是个人、团队、或是企业,都能够用 Gitee 实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)} |
|||
> IoT 管理系统 |
|||
|
|||
#### 软件架构 |
|||
软件架构说明 |
|||
## Build Setup |
|||
|
|||
```bash |
|||
# install dependencies |
|||
pnpm install |
|||
|
|||
#### 安装教程 |
|||
# serve with hot reload at localhost:8080 |
|||
pnpm run dev |
|||
|
|||
1. xxxx |
|||
2. xxxx |
|||
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/) |
|||
# build for production with minification |
|||
pnpm run build |
|||
``` |
|||
|
File diff suppressed because it is too large
@ -1,68 +1,109 @@ |
|||
import { defineConfig, loadEnv } from 'vite' |
|||
import path from 'path' |
|||
import createVitePlugins from './vite/plugins' |
|||
import { defineConfig, loadEnv } from "vite"; |
|||
import path from "path"; |
|||
import createVitePlugins from "./vite/plugins"; |
|||
|
|||
// https://vitejs.dev/config/
|
|||
export default defineConfig(({ mode, command }) => { |
|||
const env = loadEnv(mode, process.cwd()) |
|||
const { VITE_APP_ENV } = env |
|||
const env = loadEnv(mode, process.cwd()); |
|||
const { VITE_APP_ENV } = env; |
|||
return { |
|||
// 部署生产环境和开发环境下的URL。
|
|||
// 默认情况下,vite 会假设你的应用是被部署在一个域名的根路径上
|
|||
// 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
|
|||
base: VITE_APP_ENV === 'production' ? '/' : '/', |
|||
plugins: createVitePlugins(env, command === 'build'), |
|||
base: VITE_APP_ENV === "production" ? "/" : "/", |
|||
plugins: createVitePlugins(env, command === "build"), |
|||
resolve: { |
|||
// https://cn.vitejs.dev/config/#resolve-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
|
|||
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue'] |
|||
extensions: [".mjs", ".js", ".ts", ".jsx", ".tsx", ".json", ".vue"], |
|||
}, |
|||
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: { |
|||
port: 8010, |
|||
host: true, |
|||
open: true |
|||
// proxy: {
|
|||
// // https://cn.vitejs.dev/config/#server-proxy
|
|||
// '/dev-api': {
|
|||
// target: 'http://localhost:8080',
|
|||
// changeOrigin: true,
|
|||
// rewrite: (p) => p.replace(/^\/dev-api/, '')
|
|||
// }
|
|||
// }
|
|||
host: "localhost", |
|||
https: false, //是否启用 http 2
|
|||
cors: true, //为开发服务器配置 CORS , 默认启用并允许任何源
|
|||
open: true, //服务启动时自动在浏览器中打开应用
|
|||
port: Number(env.VITE_APP_PORT), |
|||
strictPort: false, //设为true时端口被占用则直接退出,不会尝试下一个可用端口
|
|||
force: false, //是否强制依赖预构建
|
|||
hmr: true, //配置HMR
|
|||
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
|
|||
css: { |
|||
postcss: { |
|||
plugins: [ |
|||
{ |
|||
postcssPlugin: 'internal:charset-removal', |
|||
postcssPlugin: "internal:charset-removal", |
|||
AtRule: { |
|||
charset: (atRule) => { |
|||
if (atRule.name === 'charset') { |
|||
if (atRule.name === "charset") { |
|||
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