Skip to content

Commit e4d9625

Browse files
committed
fix(index): use config instead of arg for experimentalNativeDepCheck
1 parent 7e2808c commit e4d9625

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

index.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ module.exports = (api, options) => {
3737
pluginOptions.bundleMainProcess == null
3838
? true
3939
: pluginOptions.bundleMainProcess
40+
if (pluginOptions.experimentalNativeDepCheck) {
41+
process.env.VCPEB_EXPERIMENTAL_NATIVE_DEP_CHECK = true
42+
}
4043

4144
const removeArg = (arg, count, rawArgs) => {
4245
const index = rawArgs.indexOf(arg)
@@ -61,9 +64,6 @@ module.exports = (api, options) => {
6164
async (args, rawArgs) => {
6265
// Use custom config for webpack
6366
process.env.IS_ELECTRON = true
64-
if (args.experimentalNativeDepCheck) {
65-
process.env.VCPEB_EXPERIMENTAL_NATIVE_DEP_CHECK = true
66-
}
6767
const builder = require('electron-builder')
6868
const yargs = require('yargs')
6969
// Import the yargs options from electron-builder
@@ -77,7 +77,6 @@ module.exports = (api, options) => {
7777
removeArg('--skipBundle', 1, rawArgs)
7878
removeArg('--report', 1, rawArgs)
7979
removeArg('--report-json', 1, rawArgs)
80-
removeArg('--experimentalNativeDepCheck', 1, rawArgs)
8180
// Parse the raw arguments using electron-builder yargs config
8281
const builderArgs = yargs
8382
.command(['build', '*'], 'Build', configureBuildCommand)
@@ -265,9 +264,6 @@ module.exports = (api, options) => {
265264
async (args, rawArgs) => {
266265
// Use custom config for webpack
267266
process.env.IS_ELECTRON = true
268-
if (args.experimentalNativeDepCheck) {
269-
process.env.VCPEB_EXPERIMENTAL_NATIVE_DEP_CHECK = true
270-
}
271267
const execa = require('execa')
272268
const preload = pluginOptions.preload || {}
273269
const mainProcessWatch = [
@@ -282,7 +278,6 @@ module.exports = (api, options) => {
282278
removeArg('--debug', 1, rawArgs)
283279
removeArg('--headless', 1, rawArgs)
284280
removeArg('--https', 1, rawArgs)
285-
removeArg('--experimentalNativeDepCheck', 1, rawArgs)
286281

287282
// Run the serve command
288283
const server = await api.service.run('serve', {

0 commit comments

Comments
 (0)