You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

241 lines
6.0 KiB

4 years ago
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.Plugin = Plugin;
  6. Object.defineProperty(exports, "File", {
  7. enumerable: true,
  8. get: function () {
  9. return _file.default;
  10. }
  11. });
  12. Object.defineProperty(exports, "buildExternalHelpers", {
  13. enumerable: true,
  14. get: function () {
  15. return _buildExternalHelpers.default;
  16. }
  17. });
  18. Object.defineProperty(exports, "resolvePlugin", {
  19. enumerable: true,
  20. get: function () {
  21. return _files.resolvePlugin;
  22. }
  23. });
  24. Object.defineProperty(exports, "resolvePreset", {
  25. enumerable: true,
  26. get: function () {
  27. return _files.resolvePreset;
  28. }
  29. });
  30. Object.defineProperty(exports, "version", {
  31. enumerable: true,
  32. get: function () {
  33. return _package.version;
  34. }
  35. });
  36. Object.defineProperty(exports, "getEnv", {
  37. enumerable: true,
  38. get: function () {
  39. return _environment.getEnv;
  40. }
  41. });
  42. Object.defineProperty(exports, "tokTypes", {
  43. enumerable: true,
  44. get: function () {
  45. return _parser().tokTypes;
  46. }
  47. });
  48. Object.defineProperty(exports, "traverse", {
  49. enumerable: true,
  50. get: function () {
  51. return _traverse().default;
  52. }
  53. });
  54. Object.defineProperty(exports, "template", {
  55. enumerable: true,
  56. get: function () {
  57. return _template().default;
  58. }
  59. });
  60. Object.defineProperty(exports, "createConfigItem", {
  61. enumerable: true,
  62. get: function () {
  63. return _item.createConfigItem;
  64. }
  65. });
  66. Object.defineProperty(exports, "loadPartialConfig", {
  67. enumerable: true,
  68. get: function () {
  69. return _config.loadPartialConfig;
  70. }
  71. });
  72. Object.defineProperty(exports, "loadOptions", {
  73. enumerable: true,
  74. get: function () {
  75. return _config.loadOptions;
  76. }
  77. });
  78. Object.defineProperty(exports, "transform", {
  79. enumerable: true,
  80. get: function () {
  81. return _transform.transform;
  82. }
  83. });
  84. Object.defineProperty(exports, "transformSync", {
  85. enumerable: true,
  86. get: function () {
  87. return _transform.transformSync;
  88. }
  89. });
  90. Object.defineProperty(exports, "transformAsync", {
  91. enumerable: true,
  92. get: function () {
  93. return _transform.transformAsync;
  94. }
  95. });
  96. Object.defineProperty(exports, "transformFile", {
  97. enumerable: true,
  98. get: function () {
  99. return _transformFile.transformFile;
  100. }
  101. });
  102. Object.defineProperty(exports, "transformFileSync", {
  103. enumerable: true,
  104. get: function () {
  105. return _transformFile.transformFileSync;
  106. }
  107. });
  108. Object.defineProperty(exports, "transformFileAsync", {
  109. enumerable: true,
  110. get: function () {
  111. return _transformFile.transformFileAsync;
  112. }
  113. });
  114. Object.defineProperty(exports, "transformFromAst", {
  115. enumerable: true,
  116. get: function () {
  117. return _transformAst.transformFromAst;
  118. }
  119. });
  120. Object.defineProperty(exports, "transformFromAstSync", {
  121. enumerable: true,
  122. get: function () {
  123. return _transformAst.transformFromAstSync;
  124. }
  125. });
  126. Object.defineProperty(exports, "transformFromAstAsync", {
  127. enumerable: true,
  128. get: function () {
  129. return _transformAst.transformFromAstAsync;
  130. }
  131. });
  132. Object.defineProperty(exports, "parse", {
  133. enumerable: true,
  134. get: function () {
  135. return _parse.parse;
  136. }
  137. });
  138. Object.defineProperty(exports, "parseSync", {
  139. enumerable: true,
  140. get: function () {
  141. return _parse.parseSync;
  142. }
  143. });
  144. Object.defineProperty(exports, "parseAsync", {
  145. enumerable: true,
  146. get: function () {
  147. return _parse.parseAsync;
  148. }
  149. });
  150. exports.types = exports.OptionManager = exports.DEFAULT_EXTENSIONS = void 0;
  151. var _file = _interopRequireDefault(require("./transformation/file/file"));
  152. var _buildExternalHelpers = _interopRequireDefault(require("./tools/build-external-helpers"));
  153. var _files = require("./config/files");
  154. var _package = require("../package.json");
  155. var _environment = require("./config/helpers/environment");
  156. function _types() {
  157. const data = _interopRequireWildcard(require("@babel/types"));
  158. _types = function () {
  159. return data;
  160. };
  161. return data;
  162. }
  163. Object.defineProperty(exports, "types", {
  164. enumerable: true,
  165. get: function () {
  166. return _types();
  167. }
  168. });
  169. function _parser() {
  170. const data = require("@babel/parser");
  171. _parser = function () {
  172. return data;
  173. };
  174. return data;
  175. }
  176. function _traverse() {
  177. const data = _interopRequireDefault(require("@babel/traverse"));
  178. _traverse = function () {
  179. return data;
  180. };
  181. return data;
  182. }
  183. function _template() {
  184. const data = _interopRequireDefault(require("@babel/template"));
  185. _template = function () {
  186. return data;
  187. };
  188. return data;
  189. }
  190. var _item = require("./config/item");
  191. var _config = require("./config");
  192. var _transform = require("./transform");
  193. var _transformFile = require("./transform-file");
  194. var _transformAst = require("./transform-ast");
  195. var _parse = require("./parse");
  196. function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
  197. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
  198. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  199. const DEFAULT_EXTENSIONS = Object.freeze([".js", ".jsx", ".es6", ".es", ".mjs"]);
  200. exports.DEFAULT_EXTENSIONS = DEFAULT_EXTENSIONS;
  201. class OptionManager {
  202. init(opts) {
  203. return (0, _config.loadOptions)(opts);
  204. }
  205. }
  206. exports.OptionManager = OptionManager;
  207. function Plugin(alias) {
  208. throw new Error(`The (${alias}) Babel 5 plugin is being run with an unsupported Babel version.`);
  209. }