BVB Source Codes

reactide Show index.js Source code

Return Download reactide: download index.js Source code - Download reactide Source code - Type:.js
  1. "use strict";
  2.  
  3. /**
  4.  * This file is a bit of a mess. If you're looking at it as a reference for how to write a preset,
  5.  * I'd recommend looking only at `function preset(){}` and ignoring the rest, unless your new preset
  6.  * really needs to work on babel-core < 6.13.x, which is unlikely.
  7.  */
  8.  
  9. /**
  10.  * This preset was originally an object, before function-based configurable presets were introduced.
  11.  * For backward-compatibility with anything that may have been loading this preset and expecting
  12.  * it to be a simple Babel config object, we maintain the old config here.
  13.  */
  14. module.exports = preset({});
  15.  
  16. // For backward compatibility with babel-core < v6.13.x, we use the 'buildPreset' property
  17. // of the preset object for the preset creation function.
  18. Object.defineProperty(module.exports, "buildPreset", {
  19.   configurable: true,
  20.   writable: true,
  21.   // We make this non-enumerable so old versions of babel-core won't see it as an unknown property,
  22.   // while allowing new versions to see it as a preset builder function.
  23.   enumerable: false,
  24.   value: preset
  25. });
  26.  
  27. function preset(context, opts) {
  28.   var moduleTypes = ["commonjs", "amd", "umd", "systemjs"];
  29.   var loose = false;
  30.   var modules = "commonjs";
  31.  
  32.   if (opts !== undefined) {
  33.     if (opts.loose !== undefined) loose = opts.loose;
  34.     if (opts.modules !== undefined) modules = opts.modules;
  35.   }
  36.  
  37.   if (typeof loose !== "boolean") throw new Error("Preset es2015 'loose' option must be a boolean.");
  38.   if (modules !== false && moduleTypes.indexOf(modules) === -1) {
  39.     throw new Error("Preset es2015 'modules' option must be 'false' to indicate no modules\n" + "or a module type which be be one of: 'commonjs' (default), 'amd', 'umd', 'systemjs'");
  40.   }
  41.  
  42.   return {
  43.     plugins: [[require("babel-plugin-transform-es2015-template-literals"), { loose: loose }], require("babel-plugin-transform-es2015-literals"), require("babel-plugin-transform-es2015-function-name"), [require("babel-plugin-transform-es2015-arrow-functions")], require("babel-plugin-transform-es2015-block-scoped-functions"), [require("babel-plugin-transform-es2015-classes"), { loose: loose }], require("babel-plugin-transform-es2015-object-super"), require("babel-plugin-transform-es2015-shorthand-properties"), require("babel-plugin-transform-es2015-duplicate-keys"), [require("babel-plugin-transform-es2015-computed-properties"), { loose: loose }], [require("babel-plugin-transform-es2015-for-of"), { loose: loose }], require("babel-plugin-transform-es2015-sticky-regex"), require("babel-plugin-transform-es2015-unicode-regex"), require("babel-plugin-check-es2015-constants"), [require("babel-plugin-transform-es2015-spread"), { loose: loose }], require("babel-plugin-transform-es2015-parameters"), [require("babel-plugin-transform-es2015-destructuring"), { loose: loose }], require("babel-plugin-transform-es2015-block-scoping"), require("babel-plugin-transform-es2015-typeof-symbol"), modules === "commonjs" && [require("babel-plugin-transform-es2015-modules-commonjs"), { loose: loose }], modules === "systemjs" && [require("babel-plugin-transform-es2015-modules-systemjs"), { loose: loose }], modules === "amd" && [require("babel-plugin-transform-es2015-modules-amd"), { loose: loose }], modules === "umd" && [require("babel-plugin-transform-es2015-modules-umd"), { loose: loose }], [require("babel-plugin-transform-regenerator"), { async: false, asyncGenerators: false }]
  44.     // filter out falsy values
  45.     ].filter(Boolean)
  46.   };
  47. }
downloadindex.js Source code - Download reactide Source code
Related Source Codes/Software:
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
postal - 2017-06-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top