mirror of
https://github.com/electron-vite/electron-vite-vue
synced 2025-01-31 20:16:36 +08:00
chore: test pack windows platform
This commit is contained in:
parent
dfc3d86534
commit
8dc3bf26c6
@ -1,7 +1,7 @@
|
||||
process.env.NODE_ENV = 'production'
|
||||
|
||||
import { build as viteBuild } from 'vite'
|
||||
import { build as electronBuild } from 'electron-builder'
|
||||
import { build as electronBuild, Platform } from 'electron-builder'
|
||||
import { config as builderConfig } from '../configs/electron-builder.config.mjs'
|
||||
import chalk from 'chalk'
|
||||
|
||||
@ -23,17 +23,15 @@ async function buildElectron() {
|
||||
}
|
||||
|
||||
async function packElectron() {
|
||||
return electronBuild({ config: builderConfig })
|
||||
.then(result => {
|
||||
console.log(TAG, chalk.green(`[electron-builder.build result]: ${result}`))
|
||||
})
|
||||
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
|
||||
try {
|
||||
await buildElectron()
|
||||
await packElectron()
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
process.exit(1)
|
||||
}
|
||||
await buildElectron()
|
||||
await packElectron()
|
||||
|
Loading…
x
Reference in New Issue
Block a user