fix: vite

This commit is contained in:
https://blog.iamtsm.cn
2023-07-07 19:26:31 +08:00
parent 33daf4da4f
commit c18e87068e
2 changed files with 16 additions and 14 deletions

View File

@@ -1,12 +1,12 @@
{
"version": "10.2.3",
"version": "10.2.5",
"ws": {
"port": 8444,
"host": "ws://127.0.0.1:8444"
},
"wss": {
"port": 8444,
"host": "wss://域名 || wss://ip:8444"
"host": "wss://域名 或者 wss://ip:8444"
},
"api": {
"port": 9092,

View File

@@ -1,16 +1,18 @@
const path = require("path");
const glob = require("glob");
const { fileURLToPath } = require("url");
const copy = require("rollup-plugin-copy");
import path from "path";
import * as glob from "glob";
import { fileURLToPath } from 'url';
import copy from "rollup-plugin-copy";
const url = import.meta.url;
module.exports = {
export default {
plugins: [
copy({
targets: [
{ src: 'res/*.html', dest: 'res/dist' },
{ src: 'res/image/*', dest: 'res/dist/image' }
]
{ src: 'res/*.html', dest: 'res/dist' },
{ src: 'res/image/*', dest: 'res/dist/image' }
],
hook: 'writeBundle',
verbose: true
})
],
build: {
@@ -25,7 +27,7 @@ module.exports = {
])
),
output: {
dir : "./res/dist/",
dir: "./res/dist/",
entryFileNames: "[name].min.js",
assetFileNames: "css/[name].min[extname]"
},
@@ -33,9 +35,9 @@ module.exports = {
minify: "terser",
terserOptions: {
compress: true,
mangle:true,
toplevel:false,
keep_classnames:false
mangle: true,
toplevel: false,
keep_classnames: false
},
reportCompressedSize: false,
sourcemap: false,