在上游 gitee.com/676015863/unicut 基础上做的自托管改造,使其可脱离官方账号体系 与 CDN 独立运行。详见 CHANGELOG.md。 主要能力 - 免登录:GUEST_USER 直接使用核心功能,checkAuth 不再拦截 - 本机 AI:对话 mimo-v2.6-flash(同源 /newapi/v1)、视觉 deepseek-v4-flash-vision-exp、 生图 /omniai、生视频 /civideo;密钥仅存服务端(nginx 占位符 + entrypoint 注入) - AI 一键出片:图片+标题 → AI 文案 → 人声/语速/情绪 → 确认生成直接排时间轴, 并支持转场、图片运镜、字幕位置/大小/配色/入场动画 - 离线可用:工程数据 IndexedDB + 项目文件 JSON 双写;官方素材走同源 /cdn/ 反代; 无 OPFS 时素材回落 IndexedDB files 表 修复 - 账号类接口本地短路,不再反复弹「Header parameter [authorization] cannot be empty」 - isFSApiSupported 改取值判断,修 OPFS 判定错误导致卡在文件夹引导页 - 模板素材统一 /cdn/ 改写 + nginx 兜底转发,修缩略图全裂 - 剔除素材已失效的模板(上游 CDN 已删,点开必卡 loading 50%) - 补齐 SDK 内置 4 张滤镜贴图,修画布卡 loading 0% - 封面上传失败不再中断整次保存 品牌与页面 - 「云剪」改为 UniCut - 首页删除收费标准栏目;顶部菜单移除 GitHub/Gitee;底部栏整体下线 安全 - .env 与 public/local-ai.json(含密钥)已在 .gitignore,不入库 - public/local-ai.json.example 仅含占位符
137 lines
3.6 KiB
TypeScript
137 lines
3.6 KiB
TypeScript
import { defineConfig } from 'vite';
|
|
//@ts-ignore
|
|
import path from 'path';
|
|
import react from '@vitejs/plugin-react';
|
|
import vitePluginImp from 'vite-plugin-imp';
|
|
import { visualizer } from 'rollup-plugin-visualizer';
|
|
import { terser } from 'rollup-plugin-terser';
|
|
|
|
//@ts-ignore
|
|
const resolve = url => path.resolve(__dirname, url);
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
resolve: {
|
|
alias: {
|
|
'@components': resolve('./src/components'),
|
|
'@server': resolve('./src/server'),
|
|
'@pages': resolve('./src/pages'),
|
|
'@language': resolve('./src/language'),
|
|
'@hooks': resolve('./src/hooks'),
|
|
'@theme': resolve('./src/theme'),
|
|
'@layout': resolve('./src/layout'),
|
|
'@stores': resolve('./src/stores'),
|
|
'@utils': resolve('./src/utils'),
|
|
'@config': resolve('./src/config'),
|
|
'@less': resolve('./src/less'),
|
|
'@images': resolve('./src/assets/images'),
|
|
'@icons': resolve('./src/icons'),
|
|
'@plugins': resolve('./src/pages/editor/plugins'),
|
|
'@database': resolve('./src/database'),
|
|
'@services': resolve('./src/services'),
|
|
// 'video-core-sdk': resolve('C:/E/gitlab/h5-video/packages/video-core/src/react-pixi/CoreSDK.tsx'),
|
|
},
|
|
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json'], // 省略扩展名
|
|
},
|
|
plugins: [
|
|
visualizer({
|
|
filename: 'dist/stats.html',
|
|
open: false,
|
|
gzipSize: true,
|
|
brotliSize: true,
|
|
}),
|
|
react({
|
|
babel: {
|
|
plugins: [
|
|
['@babel/plugin-proposal-decorators', { legacy: true }],
|
|
['@babel/plugin-proposal-class-properties', { loose: true }],
|
|
],
|
|
},
|
|
}),
|
|
vitePluginImp({
|
|
libList: [
|
|
{
|
|
libName: '@icon-park/react',
|
|
libDirectory: 'es/icons',
|
|
camel2DashComponentName: false,
|
|
},
|
|
{
|
|
libName: 'lodash',
|
|
libDirectory: '',
|
|
camel2DashComponentName: false,
|
|
},
|
|
// {
|
|
// libName: '@douyinfe/semi-ui',
|
|
// },
|
|
],
|
|
}),
|
|
],
|
|
css: {
|
|
modules: {
|
|
generateScopedName: '[name]__[local]__[hash:5]',
|
|
},
|
|
preprocessorOptions: {
|
|
less: {
|
|
// 支持内联 javascript
|
|
javascriptEnabled: true,
|
|
},
|
|
},
|
|
},
|
|
// 入口
|
|
build: {
|
|
rollupOptions: {
|
|
output: {
|
|
chunkFileNames: 'homeAssets/js/[name]-[hash].js',
|
|
entryFileNames: 'homeAssets/js/[name]-[hash].js',
|
|
assetFileNames: 'homeAssets/[ext]/[name]-[hash].[ext]',
|
|
},
|
|
input: {
|
|
main: resolve('index.html'),
|
|
},
|
|
manualChunks: {
|
|
'opencv-ts': ['opencv-ts'],
|
|
},
|
|
plugins: [
|
|
terser({
|
|
compress: {
|
|
drop_console: true,
|
|
drop_debugger: true,
|
|
pure_funcs: ['console.log', 'console.warn', 'console.error'],
|
|
},
|
|
format: { comments: false },
|
|
}),
|
|
visualizer(),
|
|
],
|
|
},
|
|
minify: 'terser',
|
|
terserOptions: {
|
|
compress: {
|
|
//生产环境时移除console
|
|
drop_console: true,
|
|
drop_debugger: true,
|
|
},
|
|
},
|
|
},
|
|
base: '/', // 公共基础路径
|
|
server: {
|
|
host: '0.0.0.0',
|
|
port: 3005,
|
|
proxy: {
|
|
'/cgi-bin': {
|
|
target: 'https://video.h5ds.com',
|
|
changeOrigin: true,
|
|
},
|
|
'/api': {
|
|
target: 'https://video.h5ds.com',
|
|
// target: 'http://192.168.31.153:8882',
|
|
// target: 'https://video-business.i.h5ds.com',
|
|
changeOrigin: true,
|
|
},
|
|
// '/video': {
|
|
// target: 'https://cdn.h5ds.com',
|
|
// changeOrigin: true,
|
|
// },
|
|
},
|
|
},
|
|
});
|