electron-builder use npm command

This commit is contained in:
草鞋没号
2021-12-14 16:16:43 +08:00
parent 7b32a5ff4c
commit 321ff2ddd7
4 changed files with 36 additions and 55 deletions

View File

@@ -1,8 +1,6 @@
process.env.NODE_ENV = 'production'
import { build as viteBuild } from 'vite'
import { build as electronBuild, Platform } from 'electron-builder'
import { config as builderConfig } from '../configs/electron-builder.config.mjs'
import chalk from 'chalk'
const TAG = chalk.bgBlue(' build.mjs ')
@@ -22,16 +20,5 @@ async function buildElectron() {
}
}
async function packElectron() {
return electronBuild({
config: builderConfig,
// if you want to build windows platform
// targets: Platform.WINDOWS.createTarget(),
}).then(result => {
console.log(TAG, 'files:', chalk.green(result))
})
}
// bootstrap
await buildElectron()
await packElectron()