Skip to content
This repository has been archived by the owner on May 11, 2018. It is now read-only.

Fill data with electron as a target. #229

Merged
merged 11 commits into from
Mar 29, 2017
Prev Previous commit
Next Next commit
Remove electron to chrome stuff.
  • Loading branch information
yavorsky committed Mar 28, 2017
commit 7c43c0eafbf24dae42104ecadcd6317b37112016
13 changes: 1 addition & 12 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import browserslist from "browserslist";
import builtInsList from "../data/built-ins.json";
import { defaultWebIncludes } from "./default-includes";
import moduleTransformations from "./module-transformations";
import normalizeOptions, { getElectronChromeVersion } from "./normalize-options.js";
import normalizeOptions from "./normalize-options.js";
import pluginList from "../data/plugins.json";
import transformPolyfillRequirePlugin from "./transform-polyfill-require-plugin";

Expand Down Expand Up @@ -104,17 +104,6 @@ export const getTargets = (targets = {}) => {
delete targetOpts.uglify;
}

// Replace Electron target with its Chrome equivalent
if (targetOpts.electron) {
const electronChromeVersion = getElectronChromeVersion(targetOpts.electron);

targetOpts.chrome = targetOpts.chrome
? Math.min(targetOpts.chrome, electronChromeVersion)
: electronChromeVersion;

delete targetOpts.electron;
}

const browserOpts = targetOpts.browsers;
if (isBrowsersQueryValid(browserOpts)) {
const queryBrowsers = getLowestVersions(browserslist(browserOpts));
Expand Down
12 changes: 0 additions & 12 deletions src/normalize-options.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import invariant from "invariant";
import { electronToChromium } from "electron-to-chromium";
import builtInsList from "../data/built-ins.json";
import { defaultWebIncludes } from "./default-includes";
import moduleTransformations from "./module-transformations";
Expand Down Expand Up @@ -70,17 +69,6 @@ export const validateModulesOption = (modulesOpt = "commonjs") => {
return modulesOpt;
};

export const getElectronChromeVersion = (electronVersion) => {
const electronChromeVersion = parseInt(electronToChromium(electronVersion), 10);

invariant(
!!electronChromeVersion,
`Electron version ${electronVersion} is either too old or too new`
);

return electronChromeVersion;
};

export default function normalizeOptions(opts) {
// TODO: remove whitelist in favor of include in next major
if (opts.whitelist && !hasBeenWarned) {
Expand Down