|
@@ -4,6 +4,7 @@ import eslint from 'vite-plugin-eslint'
|
|
|
import { resolve } from 'path'
|
|
import { resolve } from 'path'
|
|
|
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
|
|
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
|
|
|
import electron from 'vite-electron-plugin'
|
|
import electron from 'vite-electron-plugin'
|
|
|
|
|
+import obfuscatorPlugin from "vite-plugin-javascript-obfuscator"
|
|
|
|
|
|
|
|
export default () => defineConfig({
|
|
export default () => defineConfig({
|
|
|
base: './',
|
|
base: './',
|
|
@@ -21,9 +22,22 @@ export default () => defineConfig({
|
|
|
symbolId: 'icon-[dir]-[name]'
|
|
symbolId: 'icon-[dir]-[name]'
|
|
|
}),
|
|
}),
|
|
|
electron({
|
|
electron({
|
|
|
- include: ['electron'],
|
|
|
|
|
|
|
+ include: ['electron/main.js'],
|
|
|
outDir: 'dist/electron/'
|
|
outDir: 'dist/electron/'
|
|
|
}),
|
|
}),
|
|
|
|
|
+ obfuscatorPlugin({
|
|
|
|
|
+ debugger: false,
|
|
|
|
|
+ apply: "build",
|
|
|
|
|
+ options: {
|
|
|
|
|
+ compact: true,
|
|
|
|
|
+ deadCodeInjection: true,
|
|
|
|
|
+ debugProtection: true,
|
|
|
|
|
+ disableConsoleOutput: true,
|
|
|
|
|
+ renameGlobals: true,
|
|
|
|
|
+ splitStrings: true,
|
|
|
|
|
+ unicodeEscapeSequence: true
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
],
|
|
],
|
|
|
server: {
|
|
server: {
|
|
|
host: '0.0.0.0',
|
|
host: '0.0.0.0',
|
|
@@ -32,9 +46,6 @@ export default () => defineConfig({
|
|
|
strictPort: false,
|
|
strictPort: false,
|
|
|
https: false,
|
|
https: false,
|
|
|
},
|
|
},
|
|
|
- // esbuild: {
|
|
|
|
|
- // drop: ['console', 'debugger'] // build 移除打印
|
|
|
|
|
- // },
|
|
|
|
|
build: {
|
|
build: {
|
|
|
rollupOptions: {
|
|
rollupOptions: {
|
|
|
input: {
|
|
input: {
|