Support electron version in a string format.
This commit is contained in:
parent
cf5ea69073
commit
1e4e071c25
@ -100,6 +100,10 @@ export const getTargets = (targets = {}) => {
|
||||
targetOpts.node = getCurrentNodeVersion();
|
||||
}
|
||||
|
||||
if (typeof targetOpts.electron === "string") {
|
||||
targetOpts.electron = parseFloat(targetOpts.electron);
|
||||
}
|
||||
|
||||
if (targetOpts.hasOwnProperty("uglify") && !targetOpts.uglify) {
|
||||
delete targetOpts.uglify;
|
||||
}
|
||||
|
||||
@ -18,6 +18,14 @@ describe("babel-preset-env", () => {
|
||||
node: parseFloat(process.versions.node)
|
||||
});
|
||||
});
|
||||
|
||||
it("transforms electron version to a number", function() {
|
||||
assert.deepEqual(babelPresetEnv.getTargets({
|
||||
electron: "1.2"
|
||||
}), {
|
||||
electron: 1.2
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("getTargets + uglify", () => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user