feat(halo): 添加图片自动上传功能
- 新增图片处理工具模块 `src/utils/image.ts`,包含图片引用提取、绝对路径解析和路径替换功能 - 新增图片上传服务 `src/service/image-uploader.ts`,支持调用 Halo 媒体 API 上传图片并实现缓存机制 - 在设置界面添加图片上传开关和上传路径配置项 - 更新发布流程,在提交到 Halo 前自动检测并上传本地图片,替换为远程 URL - 添加英文、简体中文和繁体中文的国际化文案 - 更新插件版本至 1.1.1 并完善相关配置文件
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
import { defineConfig } from "@rslib/core";
|
||||
import builtins from "builtin-modules";
|
||||
|
||||
const banner = `/*
|
||||
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
||||
if you want to view the source, please visit the github repository of this plugin
|
||||
*/
|
||||
`;
|
||||
|
||||
export default defineConfig({
|
||||
source: {
|
||||
entry: {
|
||||
main: "./src/main.ts",
|
||||
},
|
||||
},
|
||||
lib: [
|
||||
{
|
||||
format: "cjs",
|
||||
bundle: true,
|
||||
syntax: "es2018",
|
||||
autoExternal: false,
|
||||
banner: {
|
||||
js: banner,
|
||||
},
|
||||
output: {
|
||||
externals: [
|
||||
"obsidian",
|
||||
"electron",
|
||||
"@codemirror/autocomplete",
|
||||
"@codemirror/collab",
|
||||
"@codemirror/commands",
|
||||
"@codemirror/language",
|
||||
"@codemirror/lint",
|
||||
"@codemirror/search",
|
||||
"@codemirror/state",
|
||||
"@codemirror/view",
|
||||
"@lezer/common",
|
||||
"@lezer/highlight",
|
||||
"@lezer/lr",
|
||||
...builtins,
|
||||
],
|
||||
distPath: {
|
||||
root: ".",
|
||||
},
|
||||
cleanDistPath: false,
|
||||
minify: {
|
||||
js: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
Reference in New Issue
Block a user