Files
tl-rtc-file/svr/vite.config.js
https://blog.iamtsm.cn 137c22a702 feat: inndexdb file setting
feat: wxapp scan login
feat: auto join fixed room setting
feat: local netword room scan setting
feat: message dot setting
feat: system room
feat: mysql table index perf
feat: message top/admin flag
feat: custom file transfer setting
feat: code perf
feat: setting perf
feat: log perf
feat: css perf
fix: url args encode
2023-10-28 15:03:00 +08:00

46 lines
1.4 KiB
JavaScript

import path from "path";
import * as glob from "glob";
import { fileURLToPath } from 'url';
import copy from "rollup-plugin-copy";
const url = import.meta.url;
export default {
plugins: [
copy({
targets: [
{ src: 'web-res/*.html', dest: 'web-res/dist' },
{ src: 'web-res/image/*', dest: 'web-res/dist/image' },
{ src: 'static/*', dest: 'web-res/dist/static' },
],
hook: 'writeBundle',
verbose: true
})
],
build: {
rollupOptions: {
input: Object.fromEntries(
glob.sync('web-res/*(js|css)/*.*(js|css)').map(file => [
path.relative(
'./web-res',
file.slice(0, file.length - path.extname(file).length)
),
fileURLToPath(new URL(file, url))
])
),
output: {
dir: "./web-res/dist/",
entryFileNames: "[name].min.js",
assetFileNames: "css/[name].min[extname]"
},
},
minify: "terser",
terserOptions: {
compress: true,
mangle: true,
toplevel: false,
keep_classnames: false
},
reportCompressedSize: false,
sourcemap: false,
},
};