Inheritance with Grunt? *electron-packager*


#1

Hello, I was wondering if there was a way in grunt to sort of make a “template” of the options so different builds can be shorter. Right now I have something like this

'electron-packager': {
    buildWithIMZ: {
        options: {
            platform        : os.platform(),
            arch            : os.arch(),
            dir             : '.',
            out             : '../gameBuilds/buildWithIMZ',
            name            : artifactIdIMZ,
            executableName  : 'run',
            electronVersion : '1.8.2',
            asar            : true,
            overwrite       : true
        }
    },
    buildWithoutIMZ: {
        options: {
            platform        : os.platform(),
            arch            : os.arch(),
            dir             : '.',
            out             : '../gameBuilds/buildWithoutIMZ',
            name            : artifactIdNonIMZ,
            executableName  : 'run',
            electronVersion : '1.8.2',
            asar            : true,                  
            overwrite       : true
        }

but I’d like for it to be like this:

default: {
options: {
platform : os.platform(),
arch : os.arch(),
dir : ‘.’,
executableName : ‘run’,
electronVersion : ‘1.8.2’,
asar : true,
overwrite : true
}
},
buildWithIMZ: {
options: {
out : ‘…/gameBuilds/buildWithIMZ’,
name : artifactId . ‘-imz’
}
},
buildWithoutIMZ: {
options: {
out : ‘…/gameBuilds/buildWithoutIMZ’,
name : artifactId . ‘-noimz’
}
}

So that all the tasks do is just look at the rest of the options in the one named default then use what they have inside them. Is this possible or a feature to be?


#2

I’m looking here:

and the second part where the buildcustom is, I’m unsure as to how to use it.