Merge pull request #252 from yavorsky/electron-string
Support electron version in a string format.
This commit is contained in:
commit
bfe22a945a
@ -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