Files
pqs-9100_client/electron/config/bin.js
2024-08-07 21:48:24 +08:00

109 lines
2.1 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* ee-bin 配置
* 仅适用于开发环境
*/
module.exports = {
/**
* development serve ("frontend" "electron" )
* ee-bin dev
*/
dev: {
frontend: {
directory: './frontend',
cmd: 'npm',
args: ['run', 'dev'],
protocol: 'http://',
hostname: 'localhost',
port: 18091,
indexPath: 'index.html'
},
electron: {
directory: './',
cmd: 'electron',
args: ['.', '--env=local', '--color=always'], // --env: local|prod; '--color=always' 控制台颜色
}
},
/**
* 构建
* ee-bin build
*/
build: {
frontend: {
directory: './frontend',
cmd: 'npm',
args: ['run', 'build'],
}
},
/**
* 移动资源
* ee-bin move
*/
move: {
frontend_dist: {
dist: './frontend/dist',
target: './public/dist'
}
},
/**
* 预发布模式prod
* ee-bin start
*/
start: {
directory: './',
cmd: 'electron',
args: ['.', '--env=prod']
},
/**
* 加密
*/
encrypt: {
// confusion - 压缩混淆加密
// bytecode - 字节码加密
// strict - 先混淆加密,然后字节码加密
type: 'confusion',
// 文件匹配
// ! 符号开头的意思是过滤
files: [
'electron/**/*.(js|json)',
'!electron/config/encrypt.js',
'!electron/config/nodemon.json',
'!electron/config/builder.json',
'!electron/config/bin.json',
],
// 需要加密的文件后缀暂时只支持js
fileExt: ['.js'],
// 混淆加密配置
confusionOptions: {
// 压缩成一行
compact: true,
// 删除字符串文字并将其放置在一个特殊数组中
stringArray: true,
// 对stringArray的所有字符串文字进行编码'none' | 'base64' | 'rc4'
stringArrayEncoding: ['none'],
// 注入死代码,注:影响性能
deadCodeInjection: false,
}
},
/**
* 执行自定义命令
* ee-bin exec
*/
exec: {
node_v: {
directory: './',
cmd: 'node',
args: ['-v'],
},
npm_v: {
directory: './',
cmd: 'npm',
args: ['-v'],
},
},
};