Files
plugin-s3/console/vite.config.ts
longjuan 91a61fd1d2 feat: Associate files originally in s3 (#59)
```release-note
关联从其他渠道上传至 s3 的文件
```
【插件】->【对象存储(Amazon S3 协议)】->【关联s3文件】
![image](https://github.com/halo-sigs/plugin-s3/assets/28662535/83096e23-d362-4924-b2f0-6984683d87cf)
![image](https://github.com/halo-sigs/plugin-s3/assets/28662535/6dd74842-f9a5-4e3c-9a93-36b4b188ecf6)

目前待优化的功能:
- [ ] 列出未关联的文件时会查询多次数据库,期望优化成只查询一次,但是代码改动较大。
2023-09-11 16:04:09 +00:00

48 lines
1.1 KiB
TypeScript

import { fileURLToPath, URL } from "url";
import { defineConfig } from "vite";
import Vue from "@vitejs/plugin-vue";
import VueJsx from "@vitejs/plugin-vue-jsx";
import Icons from "unplugin-icons/vite";
const pluginEntryName = "PluginS3ObjectStorage";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [Vue(), VueJsx(), Icons({ compiler: "vue3" })],
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)),
},
},
build: {
outDir: fileURLToPath(
new URL("../src/main/resources/console", import.meta.url)
),
emptyOutDir: true,
lib: {
entry: "src/index.ts",
name: pluginEntryName,
formats: ["iife"],
fileName: () => "main.js",
},
rollupOptions: {
external: [
"vue",
"@halo-dev/console-shared",
"@halo-dev/components",
"vue-router",
],
output: {
globals: {
vue: "Vue",
"vue-router": "VueRouter",
"@halo-dev/components": "HaloComponents",
"@halo-dev/console-shared": "HaloConsoleShared",
},
extend: true,
},
},
},
});