const err = new Error("Babili requires babel-core>=6.14.0. Upgrade babel-core or tools dependent on babel-core to recent versions");

function isVersion(versionStr) {
  const version = versionStr.split(".").map((p) => parseInt(p));
  return version[0] >= 6 && version[1] >= 14;
}

module.exports = {
  plugins: [function({version}) {
    if (!isVersion(version)) {
      throw err;
    }
    return {
      visitor: {}
    };
  }],
};

Object.defineProperty(module.exports, "buildPreset", {
  configurable: true,
  writable: true,
  enumerable: false,
  value: preset
});

function preset(context) {
  if (!isVersion(context.version)) {
    throw err;
  }
  return {
    minified: true,
    plugins: [
      require("babel-plugin-minify-constant-folding"),
      require("babel-plugin-minify-dead-code-elimination"),
      require("babel-plugin-minify-flip-comparisons"),
      require("babel-plugin-minify-guarded-expressions"),
      require("babel-plugin-minify-infinity"),
      require("babel-plugin-minify-mangle-names"),
      require("babel-plugin-minify-replace"),
      require("babel-plugin-minify-simplify"),
      require("babel-plugin-minify-type-constructors"),
      require("babel-plugin-transform-member-expression-literals"),
      require("babel-plugin-transform-merge-sibling-variables"),
      require("babel-plugin-transform-minify-booleans"),
      require("babel-plugin-transform-property-literals"),
      require("babel-plugin-transform-simplify-comparison-operators"),
      require("babel-plugin-transform-undefined-to-void"),
    ],
  };
}

@@ -1,673 +1,23 @@
-const err = new Error(%22Babili requires babel-core%3E=6.14.0. Upgrade babel-core or tools dependent on babel-core to recent versions%22);%0A%0Afunction isVersion(versionStr) %7B%0A  const version = versionStr.split(%22.%22).map((p) =%3E parseInt(p));%0A  return version%5B0%5D %3E= 6 && version%5B1%5D %3E= 14;%0A%7D%0A%0Amodule.exports = %7B%0A  plugins: %5Bfunction(%7Bversion%7D) %7B%0A    if (!isVersion(version)) %7B%0A      throw err;%0A    %7D%0A    return %7B%0A      visitor: %7B%7D%0A    %7D;%0A  %7D%5D,%0A%7D;%0A%0AObject.defineProperty(module.exports, %22buildPreset%22, %7B%0A  configurable: true,%0A  writable: true,%0A  enumerable: false,%0A  value: preset%0A%7D);%0A%0Afunction preset(context) %7B%0A  if (!isVersion(context.version)) %7B%0A    throw err;%0A  %7D%0A  return %7B%0A  
+module.exports = %7B%0A
   mi
@@ -30,18 +30,16 @@
 : true,%0A
-  
   plugin
@@ -43,18 +43,16 @@
 gins: %5B%0A
-  
     requ
@@ -92,26 +92,24 @@
 -folding%22),%0A
-  
     require(
@@ -150,34 +150,32 @@
 mination%22),%0A    
-  
 require(%22babel-p
@@ -203,26 +203,24 @@
 parisons%22),%0A
-  
     require(
@@ -259,26 +259,24 @@
 ressions%22),%0A
-  
     require(
@@ -304,34 +304,32 @@
 infinity%22),%0A    
-  
 require(%22babel-p
@@ -353,34 +353,32 @@
 le-names%22),%0A    
-  
 require(%22babel-p
@@ -397,34 +397,32 @@
 -replace%22),%0A    
- 
- 
 require(%22babel-p
@@ -442,26 +442,24 @@
 simplify%22),%0A
-  
     require(
@@ -496,34 +496,32 @@
 tructors%22),%0A    
-  
 require(%22babel-p
@@ -562,34 +562,32 @@
 literals%22),%0A    
- 
- 
 require(%22babel-p
@@ -625,34 +625,32 @@
 ariables%22),%0A    
-  
 require(%22babel-p
@@ -680,26 +680,24 @@
 booleans%22),%0A
-  
     require(
@@ -737,34 +737,32 @@
 literals%22),%0A    
-  
 require(%22babel-p
@@ -814,18 +814,16 @@
 %22),%0A    
-  
 require(
@@ -873,16 +873,10 @@
 ,%0A  
- 
- 
 %5D,%0A
-  
 %7D;%0A
-%7D%0A

Revert "Throw upgrade error when babel version is less than 6.14.0" (#125)