Skip to content

Commit 0e731f8

Browse files
committed
fix(build): args not being parsed properly
1 parent eb05fe3 commit 0e731f8

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

index.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,16 @@ module.exports = (api, options) => {
2626
`See https://www.electron.build/cli for cli options\n` +
2727
`See https://github.com/nklayman/vue-cli-plugin-electron-builder for more details about this plugin.`
2828
},
29-
async args => {
29+
async (args, rawArgs) => {
3030
const buildRenderer = require('@vue/cli-service/lib/commands/build').build
3131
const fs = require('fs-extra')
3232
const builder = require('electron-builder')
33+
const yargs = require('yargs')
34+
const configureBuildCommand = require('electron-builder/out/builder')
35+
.configureBuildCommand
36+
const builderArgs = yargs
37+
.command(['build', '*'], 'Build', configureBuildCommand)
38+
.parse(rawArgs)
3339
const rendererConfig = api.resolveChainableWebpackConfig()
3440
const defaultBuildConfig = {
3541
directories: {
@@ -124,7 +130,7 @@ module.exports = (api, options) => {
124130
...defaultBuildConfig,
125131
...userBuildConfig
126132
},
127-
...args
133+
...builderArgs
128134
})
129135
.then(() => {
130136
// handle result

0 commit comments

Comments
 (0)