init
This commit is contained in:
commit
b92686ce29
15
.env.minio.example
Normal file
15
.env.minio.example
Normal file
@ -0,0 +1,15 @@
|
||||
# MINIO_ROOT_USER 和 MINIO_ROOT_PASSWORD 设置 MinIO 服务器的根账户。
|
||||
# 该用户拥有在部署中对任何资源执行 S3 和管理 API 操作的无限制权限。
|
||||
# 省略则使用默认值 'minioadmin:minioadmin'。
|
||||
# MinIO 建议将设置非默认值作为最佳实践,无论环境如何
|
||||
|
||||
MINIO_ROOT_USER=admin
|
||||
MINIO_ROOT_PASSWORD=admin123
|
||||
|
||||
# MINIO_VOLUMES 设置 MinIO 服务器要使用的存储卷或路径。
|
||||
|
||||
MINIO_VOLUMES="./minio-resources"
|
||||
|
||||
# MINIO_OPTS 设置要传递给 MinIO 服务器的任何其他命令行选项。
|
||||
# 例如,`--console-address :9001` 设置 MinIO 控制台监听端口
|
||||
MINIO_OPTS="--console-address :9001"
|
9
.gitignore
vendored
Normal file
9
.gitignore
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
node_modules
|
||||
dist
|
||||
|
||||
.minio.sys
|
||||
minio-resources
|
||||
|
||||
.env*
|
||||
|
||||
!.env*example
|
1
.markignore
Normal file
1
.markignore
Normal file
@ -0,0 +1 @@
|
||||
.gitignore
|
33
index.html
Normal file
33
index.html
Normal file
@ -0,0 +1,33 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/png" href="https://kevisual.xiongxiao.me/root/center/panda.png" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Vite + React + TS</title>
|
||||
<link rel="stylesheet" href="/src/index.css" />
|
||||
<style>
|
||||
html,
|
||||
body {
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#root {
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script type="module" src="/src/main.tsx"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
66
mark/assistant-kevisual/esm/docker-deploy.md
Normal file
66
mark/assistant-kevisual/esm/docker-deploy.md
Normal file
@ -0,0 +1,66 @@
|
||||
## esm.sh docker
|
||||
|
||||
```sh
|
||||
docker pull ghcr.io/esm-dev/esm.sh
|
||||
```
|
||||
|
||||
```sh
|
||||
docker pull m.daocloud.io/ghcr.io/esm-dev/esm.sh
|
||||
```
|
||||
|
||||
## 部署配置
|
||||
|
||||
`config.json`
|
||||
|
||||
```json
|
||||
{
|
||||
"port": 8080,
|
||||
"npmRegistry": "https://registry.npmjs.org/"
|
||||
}
|
||||
```
|
||||
|
||||
`compose.yml`
|
||||
|
||||
```yml
|
||||
version: '3'
|
||||
services:
|
||||
esm:
|
||||
image: ghcr.io/esm-dev/esm.sh:latest
|
||||
container_name: esm
|
||||
ports:
|
||||
- '12000:8080'
|
||||
environment:
|
||||
- LOG_LEVEL=debug
|
||||
volumes:
|
||||
- ./config.json:/esmd/config.json
|
||||
- ./data:/esmd
|
||||
```
|
||||
|
||||
## 介绍
|
||||
|
||||
Available environment variables:
|
||||
|
||||
COMPRESS:使用gzip/brotli压缩HTTP响应,默认值为true(启用)。
|
||||
CUSTOM_LANDING_PAGE_ORIGIN:自定义着陆页来源地址,默认为空。
|
||||
CUSTOM_LANDING_PAGE_ASSETS:自定义着陆页资源文件(以逗号分隔),默认为空。
|
||||
CORS_ALLOW_ORIGINS:允许的CORS来源(以逗号分隔),默认允许所有来源(*)。
|
||||
LOG_LEVEL:日志级别,可选值["debug", "info", "warn", "error"],默认为"info"。
|
||||
ACCESS_LOG:是否启用访问日志,默认false(禁用)。
|
||||
MINIFY:是否压缩构建后的JS/CSS文件,默认true(启用)。
|
||||
NPM_QUERY_CACHE_TTL:NPM查询缓存有效期,默认10分钟。
|
||||
NPM_REGISTRY:全局NPM镜像源,默认为"https://registry.npmjs.org/"。
|
||||
NPM_TOKEN:全局NPM镜像源的访问令牌。
|
||||
NPM_USER:全局NPM镜像源的访问用户名。
|
||||
NPM_PASSWORD:全局NPM镜像源的访问密码。
|
||||
SOURCEMAP:是否为构建的JS/CSS文件生成源码映射,默认true(启用)。
|
||||
STORAGE_TYPE:存储类型,可选值["fs", "s3"],默认为"fs"(本地文件系统)。
|
||||
STORAGE_ENDPOINT:存储服务端点,默认路径为"~/.esmd/storage"。
|
||||
STORAGE_REGION:S3存储区域(仅S3存储需要)。
|
||||
STORAGE_ACCESS_KEY_ID:S3存储的访问密钥ID。
|
||||
STORAGE_SECRET_ACCESS_KEY:S3存储的私有访问密钥。
|
||||
|
||||
You can also create your own Dockerfile based on ghcr.io/esm-dev/esm.sh:
|
||||
|
||||
FROM ghcr.io/esm-dev/esm.sh:latest
|
||||
ADD --chown=esm:esm ./config.json /etc/esmd/config.json
|
||||
CMD ["esmd", "--config", "/etc/esmd/config.json"]
|
13
mark/assistant-kevisual/minio/mc.md
Normal file
13
mark/assistant-kevisual/minio/mc.md
Normal file
@ -0,0 +1,13 @@
|
||||
# mc 的一些常用命令
|
||||
|
||||
|
||||
## mc
|
||||
```sh
|
||||
mc alias set 'markminio' 'http://192.168.31.39:9000' 'admin' 'admin123'
|
||||
mc mirror --watch ./mark markminio/mark --overwrite
|
||||
|
||||
mc mirror markminio/mark mark --overwrite
|
||||
|
||||
```
|
||||
|
||||
|
2
mark/assistant-kevisual/minio/minio-serve.md
Normal file
2
mark/assistant-kevisual/minio/minio-serve.md
Normal file
@ -0,0 +1,2 @@
|
||||
## minio-serve
|
||||
|
3
mark/assistant-kevisual/readme.md
Normal file
3
mark/assistant-kevisual/readme.md
Normal file
@ -0,0 +1,3 @@
|
||||
# assistant 助手
|
||||
|
||||
使用ai和本地部署,解决一切期望,尽可能解决的东西。
|
1
mark/common/alist.md
Normal file
1
mark/common/alist.md
Normal file
@ -0,0 +1 @@
|
||||
123123
|
1
mark/common/b.md
Normal file
1
mark/common/b.md
Normal file
@ -0,0 +1 @@
|
||||
this is a test4
|
0
mark/common/calibre.md
Normal file
0
mark/common/calibre.md
Normal file
0
mark/common/cherry-studio.md
Normal file
0
mark/common/cherry-studio.md
Normal file
0
mark/common/dify.md
Normal file
0
mark/common/dify.md
Normal file
0
mark/common/fastgpt.md
Normal file
0
mark/common/fastgpt.md
Normal file
0
mark/common/gitea.md
Normal file
0
mark/common/gitea.md
Normal file
0
mark/common/hoppscotch.md
Normal file
0
mark/common/hoppscotch.md
Normal file
0
mark/common/jupyter.md
Normal file
0
mark/common/jupyter.md
Normal file
0
mark/common/localsend.md
Normal file
0
mark/common/localsend.md
Normal file
0
mark/common/logseq.md
Normal file
0
mark/common/logseq.md
Normal file
0
mark/common/minio.md
Normal file
0
mark/common/minio.md
Normal file
0
mark/common/navidrome.md
Normal file
0
mark/common/navidrome.md
Normal file
0
mark/common/nginx.md
Normal file
0
mark/common/nginx.md
Normal file
0
mark/common/obsidian.md
Normal file
0
mark/common/obsidian.md
Normal file
0
mark/common/ollama.md
Normal file
0
mark/common/ollama.md
Normal file
0
mark/common/pot.md
Normal file
0
mark/common/pot.md
Normal file
0
mark/common/rust-desktop.md
Normal file
0
mark/common/rust-desktop.md
Normal file
0
mark/common/searxng.md
Normal file
0
mark/common/searxng.md
Normal file
0
mark/common/snipaster.md
Normal file
0
mark/common/snipaster.md
Normal file
0
mark/common/umami.md
Normal file
0
mark/common/umami.md
Normal file
0
mark/common/vaultwarden.md
Normal file
0
mark/common/vaultwarden.md
Normal file
0
mark/common/vllm.md
Normal file
0
mark/common/vllm.md
Normal file
0
mark/common/webdav.md
Normal file
0
mark/common/webdav.md
Normal file
0
mark/common/xiaoya.md
Normal file
0
mark/common/xiaoya.md
Normal file
0
mark/db/minio.md
Normal file
0
mark/db/minio.md
Normal file
0
mark/db/postgres.md
Normal file
0
mark/db/postgres.md
Normal file
0
mark/db/redis.md
Normal file
0
mark/db/redis.md
Normal file
15
mark/docker/proxy.md
Normal file
15
mark/docker/proxy.md
Normal file
@ -0,0 +1,15 @@
|
||||
## proxy
|
||||
|
||||
|
||||
| 源站 | 替换为 | 备注 |
|
||||
| ------------------ | --------------------- | ---------------------------------------------- |
|
||||
| docker.elastic.co | elastic.m.daocloud.io | |
|
||||
| docker.io | docker.m.daocloud.io | |
|
||||
| gcr.io | gcr.m.daocloud.io | |
|
||||
| ghcr.io | ghcr.m.daocloud.io | |
|
||||
| k8s.gcr.io | k8s-gcr.m.daocloud.io | k8s.gcr.io 已被迁移到 registry.k8s.io |
|
||||
| registry.k8s.io | k8s.m.daocloud.io | |
|
||||
| mcr.microsoft.com | mcr.m.daocloud.io | |
|
||||
| nvcr.io | nvcr.m.daocloud.io | |
|
||||
| quay.io | quay.m.daocloud.io | |
|
||||
| registry.ollama.ai | ollama.m.daocloud.io | 实验内测中,[使用方法](#加速-ollama--deepseek) |
|
1
mark/github.com/site/github-markdown-css.md
Normal file
1
mark/github.com/site/github-markdown-css.md
Normal file
@ -0,0 +1 @@
|
||||
https://github.com/sindresorhus/github-markdown-css
|
0
mark/learning/anki/anki-sync-server.md
Normal file
0
mark/learning/anki/anki-sync-server.md
Normal file
0
mark/learning/anki/anki.md
Normal file
0
mark/learning/anki/anki.md
Normal file
0
mark/mac/iterm.md
Normal file
0
mark/mac/iterm.md
Normal file
0
mark/mac/raycast.md
Normal file
0
mark/mac/raycast.md
Normal file
0
mark/npm/registry.md
Normal file
0
mark/npm/registry.md
Normal file
27
mark/pdf/mineru/download.md
Normal file
27
mark/pdf/mineru/download.md
Normal file
@ -0,0 +1,27 @@
|
||||
安装环境
|
||||
|
||||
```sh
|
||||
conda create -n mineru 'python>=3.10' -y
|
||||
conda activate mineru
|
||||
pip install -U "magic-pdf[full]" -i https://mirrors.aliyun.com/pypi/simple
|
||||
```
|
||||
|
||||
|
||||
下载模型
|
||||
```sh
|
||||
pip install modelscope
|
||||
|
||||
|
||||
curl -o download_models.py https://gcore.jsdelivr.net/gh/opendatalab/MinerU@master/scripts/download_models.py
|
||||
|
||||
python download_models.py
|
||||
```
|
||||
|
||||
配置文件在 `magic-pdf.json`
|
||||
|
||||
|
||||
使用
|
||||
```sh
|
||||
magic-pdf -p {some_pdf} -o {some_output_dir} -m auto
|
||||
magic-pdf -p test.pdf -o test -m auto
|
||||
```
|
4
mark/tools/conda/conda.md
Normal file
4
mark/tools/conda/conda.md
Normal file
@ -0,0 +1,4 @@
|
||||
|
||||
```sh
|
||||
conda init --system --all
|
||||
```
|
27
package.json
Normal file
27
package.json
Normal file
@ -0,0 +1,27 @@
|
||||
{
|
||||
"name": "@kevisual/awesome",
|
||||
"version": "0.0.1",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"minio": "MINIO_CONFIG_ENV_FILE=./.env.minio ./minio server --console-address :9001",
|
||||
"to:files": " mc mirror markminio/mark mark --overwrite",
|
||||
"to:minio": " mc mirror --watch mark markminio/mark --overwrite"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "abearxiong <xiongxiao@xiongxiao.me> (https://www.xiongxiao.me)",
|
||||
"license": "MIT",
|
||||
"packageManager": "pnpm@10.6.2",
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
"aws-sdk": "^2.1692.0",
|
||||
"minio": "^8.0.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tailwindcss/vite": "^4.1.3",
|
||||
"@vitejs/plugin-basic-ssl": "^2.0.0",
|
||||
"@vitejs/plugin-react": "^4.3.4",
|
||||
"vite": "^6.2.6"
|
||||
}
|
||||
}
|
1822
pnpm-lock.yaml
generated
Normal file
1822
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
8
readme.md
Normal file
8
readme.md
Normal file
@ -0,0 +1,8 @@
|
||||
# kevisual assistant
|
||||
|
||||
|
||||
为了加速日常生活,个人搭建资料库,个人部署,本地部署,日常使用的开源库。私有服务器值得搭建的服务。利用一切能助力生活的总结。
|
||||
|
||||
**公网的服务器叫服务器,私人搭建的是微服务器,只对个人所拥有的东西进行统计。 内容由ai生成**
|
||||
|
||||
用ai提取大模型的数据内容到本地。
|
17
services/client-mark/package.json
Normal file
17
services/client-mark/package.json
Normal file
@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "client-mark",
|
||||
"version": "0.0.1",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "abearxiong <xiongxiao@xiongxiao.me> (https://www.xiongxiao.me)",
|
||||
"license": "MIT",
|
||||
"packageManager": "pnpm@10.6.2",
|
||||
"type": "module",
|
||||
"devDependencies": {
|
||||
"@types/node": "^22.14.1"
|
||||
}
|
||||
}
|
29
services/client-mark/pnpm-lock.yaml
generated
Normal file
29
services/client-mark/pnpm-lock.yaml
generated
Normal file
@ -0,0 +1,29 @@
|
||||
lockfileVersion: '9.0'
|
||||
|
||||
settings:
|
||||
autoInstallPeers: true
|
||||
excludeLinksFromLockfile: false
|
||||
|
||||
importers:
|
||||
|
||||
.:
|
||||
devDependencies:
|
||||
'@types/node':
|
||||
specifier: ^22.14.1
|
||||
version: 22.14.1
|
||||
|
||||
packages:
|
||||
|
||||
'@types/node@22.14.1':
|
||||
resolution: {integrity: sha512-u0HuPQwe/dHrItgHHpmw3N2fYCR6x4ivMNbPHRkBVP4CvN+kiRrKHWk3i8tXiO/joPwXLMYvF9TTF0eqgHIuOw==}
|
||||
|
||||
undici-types@6.21.0:
|
||||
resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==}
|
||||
|
||||
snapshots:
|
||||
|
||||
'@types/node@22.14.1':
|
||||
dependencies:
|
||||
undici-types: 6.21.0
|
||||
|
||||
undici-types@6.21.0: {}
|
41
services/client-mark/src/listen.ts
Normal file
41
services/client-mark/src/listen.ts
Normal file
@ -0,0 +1,41 @@
|
||||
import AWS from 'aws-sdk';
|
||||
import { Client } from 'minio';
|
||||
const minioClient = new Client({
|
||||
endPoint: 'localhost',
|
||||
port: 9000,
|
||||
useSSL: false,
|
||||
accessKey: 'admin',
|
||||
secretKey: 'admin123',
|
||||
});
|
||||
|
||||
// const s3 = new AWS.S3({
|
||||
// accessKeyId: 'admin',
|
||||
// secretAccessKey: 'admin123',
|
||||
// endpoint: 'http://localhost:9000',
|
||||
// s3ForcePathStyle: true, // 使用路径样式的 URL
|
||||
// signatureVersion: 'v4',
|
||||
// });
|
||||
|
||||
// 监听事件
|
||||
const listen = async () => {
|
||||
const res = minioClient.listenBucketNotification('mark', 'common', '.md', [
|
||||
's3:ObjectCreated:*', // 监听所有对象创建事件
|
||||
// delete
|
||||
's3:ObjectRemoved:*',
|
||||
|
||||
]);
|
||||
res.on('notification', (event) => {
|
||||
console.log(event);
|
||||
});
|
||||
// const res = await minioClient.getBucketNotification('mark');
|
||||
// console.log(res);
|
||||
};
|
||||
listen();
|
||||
|
||||
const getList = async () => {
|
||||
const res = minioClient.listObjectsV2('mark', 'common', true);
|
||||
res.on('data', (event) => {
|
||||
console.log(event);
|
||||
});
|
||||
};
|
||||
// getList();
|
33
services/client-mark/tsconfig.json
Normal file
33
services/client-mark/tsconfig.json
Normal file
@ -0,0 +1,33 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "nodenext",
|
||||
"target": "esnext",
|
||||
"noImplicitAny": false,
|
||||
"outDir": "./dist",
|
||||
"sourceMap": false,
|
||||
"allowJs": true,
|
||||
"newLine": "LF",
|
||||
"baseUrl": "./",
|
||||
"typeRoots": [
|
||||
"node_modules/@types",
|
||||
"node_modules/@kevisual/types"
|
||||
],
|
||||
"declaration": true,
|
||||
"noEmit": false,
|
||||
"allowImportingTsExtensions": true,
|
||||
"emitDeclarationOnly": true,
|
||||
"moduleResolution": "NodeNext",
|
||||
"experimentalDecorators": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
"esModuleInterop": true,
|
||||
"paths": {
|
||||
"@/*": [
|
||||
"src/*"
|
||||
]
|
||||
}
|
||||
},
|
||||
"include": [
|
||||
"src/**/*.ts",
|
||||
],
|
||||
"exclude": [],
|
||||
}
|
45
src/main.tsx
Normal file
45
src/main.tsx
Normal file
@ -0,0 +1,45 @@
|
||||
import AWS from 'aws-sdk';
|
||||
// 配置 S3 客户端
|
||||
const s3 = new AWS.S3({
|
||||
accessKeyId: 'admin',
|
||||
secretAccessKey: 'admin123',
|
||||
endpoint: 'http://localhost:9000',
|
||||
s3ForcePathStyle: true, // 使用路径样式的 URL
|
||||
signatureVersion: 'v4',
|
||||
});
|
||||
|
||||
const main = async () => {
|
||||
const res = await s3
|
||||
.listObjectsV2({
|
||||
Bucket: 'mark',
|
||||
Prefix: 'mark/common',
|
||||
})
|
||||
.promise();
|
||||
console.log(res);
|
||||
};
|
||||
const getObject = async () => {
|
||||
const res = await s3
|
||||
.getObject({
|
||||
Bucket: 'mark',
|
||||
Key: 'mark/common/alist.md',
|
||||
})
|
||||
.promise();
|
||||
const content = res.Body?.toString();
|
||||
console.log(content);
|
||||
};
|
||||
|
||||
// main();
|
||||
// getObject();
|
||||
|
||||
const updateObject = async () => {
|
||||
const res = await s3
|
||||
.putObject({
|
||||
Bucket: 'mark',
|
||||
Key: 'common/b.md',
|
||||
Body: 'this is a test4',
|
||||
})
|
||||
.promise();
|
||||
console.log(res);
|
||||
};
|
||||
|
||||
// updateObject();
|
43
tsconfig.json
Normal file
43
tsconfig.json
Normal file
@ -0,0 +1,43 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2020",
|
||||
"useDefineForClassFields": true,
|
||||
"lib": [
|
||||
"ES2020",
|
||||
"DOM",
|
||||
"DOM.Iterable"
|
||||
],
|
||||
"module": "ESNext",
|
||||
"skipLibCheck": true,
|
||||
/* Bundler mode */
|
||||
"moduleResolution": "bundler",
|
||||
"allowImportingTsExtensions": true,
|
||||
"isolatedModules": true,
|
||||
"moduleDetection": "force",
|
||||
"noEmit": true,
|
||||
// "jsx": "react",
|
||||
// "jsxFragmentFactory": "Fragment",
|
||||
// "jsxFactory": "h",
|
||||
"jsx": "react-jsx",
|
||||
"baseUrl": "./",
|
||||
"typeRoots": [
|
||||
"node_modules/@types",
|
||||
"node_modules/@kevisual/types",
|
||||
],
|
||||
"paths": {
|
||||
"@/*": [
|
||||
"src/*"
|
||||
]
|
||||
},
|
||||
/* Linting */
|
||||
"strict": true,
|
||||
"noImplicitAny": false,
|
||||
"noUnusedLocals": false,
|
||||
"noUnusedParameters": false,
|
||||
"noFallthroughCasesInSwitch": true
|
||||
},
|
||||
"include": [
|
||||
"src",
|
||||
"typings.d.ts"
|
||||
]
|
||||
}
|
96
vite.config.mjs
Normal file
96
vite.config.mjs
Normal file
@ -0,0 +1,96 @@
|
||||
import { defineConfig } from 'vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
import path from 'path';
|
||||
import pkgs from './package.json' with { type: 'json' };
|
||||
const version = pkgs.version || '0.0.1';
|
||||
|
||||
const isDev = process.env.NODE_ENV === 'development';
|
||||
const basename = isDev ? '/' : pkgs?.basename || '/';
|
||||
|
||||
const checkJsh = () => {
|
||||
return process.env.SHELL === '/bin/jsh';
|
||||
};
|
||||
const isJsh = checkJsh();
|
||||
const plugins = [react(), ];
|
||||
|
||||
if (!isJsh) {
|
||||
const basicSsl = await import('@vitejs/plugin-basic-ssl');
|
||||
const tailwindcss = await import('@tailwindcss/vite');
|
||||
const defaultPlugin = basicSsl.default;
|
||||
const defaultCssPlugin = tailwindcss.default;
|
||||
plugins.push(defaultCssPlugin(),defaultPlugin());
|
||||
}
|
||||
|
||||
let target = 'https://kevisual.xiongxiao.me';
|
||||
if (isDev) {
|
||||
target = 'https://kevisual.xiongxiao.me';
|
||||
} else {
|
||||
target = 'https://kevisual.cn';
|
||||
}
|
||||
|
||||
let proxy = {
|
||||
'/root/center/': {
|
||||
target: `https://${target}/root/center/`,
|
||||
},
|
||||
'/root/system-lib/': {
|
||||
target: `https://${target}/root/system-lib/`,
|
||||
},
|
||||
'/user/login/': {
|
||||
target: `https://${target}/user/login/`,
|
||||
},
|
||||
'/api': {
|
||||
target: `https://${target}`,
|
||||
changeOrigin: true,
|
||||
ws: true,
|
||||
rewriteWsOrigin: true,
|
||||
cookieDomainRewrite: 'localhost',
|
||||
},
|
||||
};
|
||||
/**
|
||||
* @see https://vitejs.dev/config/
|
||||
*/
|
||||
export default defineConfig({
|
||||
plugins,
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': path.resolve(__dirname, './src')
|
||||
},
|
||||
},
|
||||
base: basename,
|
||||
define: {
|
||||
DEV_SERVER: JSON.stringify(process.env.NODE_ENV === 'development'),
|
||||
APP_VERSION: JSON.stringify(version),
|
||||
BASE_NAME: JSON.stringify(basename),
|
||||
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
|
||||
global: 'window',
|
||||
},
|
||||
build: {
|
||||
target: 'modules',
|
||||
// lib: {
|
||||
// entry: './src/libs.ts',
|
||||
// formats: ['es'],
|
||||
// fileName: (format) => `render.js`,
|
||||
// },
|
||||
},
|
||||
server: {
|
||||
port: 7008,
|
||||
host: '0.0.0.0',
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://localhost:3000',
|
||||
changeOrigin: true,
|
||||
ws: true,
|
||||
rewriteWsOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/api/, '/api'),
|
||||
},
|
||||
'/api/router': {
|
||||
target: 'ws://localhost:3000',
|
||||
changeOrigin: true,
|
||||
ws: true,
|
||||
rewriteWsOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/api/, '/api'),
|
||||
},
|
||||
...proxy,
|
||||
},
|
||||
},
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user