Skip to content

Hope build command can add options for conditional compilation #494

@towertop

Description

@towertop

I'm using electron-builder 5.1.0 to generate an installer for my app. I hoped the build command can help me a way to run some logging or checking code only in test version but it looks not support this yet.

My idea is like to add an option "--add-pakcage-json-field" to build command. It only put the given field and string to the application package.json.

So I use command:
build --win --x64 --add-package-json-field "env" "test"

My app get a modified package.json:

{
// other fields like name, version
// and a new item appended
"env": "test"
}

That way I can check the 'env' field in code and package my app in 2 commands, rather than modifying code manually.

Look forward to this feature if possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions