1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4  value: true
5});
6exports.generateFunctionMap = generateFunctionMap;
7
8function _importMetroFromProject() {
9  const data = require("../importMetroFromProject");
10
11  _importMetroFromProject = function () {
12    return data;
13  };
14
15  return data;
16}
17
18function generateFunctionMap(projectRoot, ast, context) {
19  //  `x_facebook_sources` is a source map feature that we disable by default since it isn't documented
20  // and doesn't appear to add much value to the DX, it also increases bundle time, and source map size.
21  // The feature supposedly provides improved function names for anonymous functions, but we will opt towards
22  // linting to prevent users from adding anonymous functions for important features like React components.
23  //
24  // Here is an example stack trace for a component that throws an error
25  // in the root component (which is an anonymous function):
26  //
27  // Before:
28  // - <anonymous> App.js:5:9
29  // - renderApplication renderApplication.js:54:5
30  // - runnables.appKey.run AppRegistry.js:117:26
31  //
32  // After:
33  // - _default App.js:5:9
34  // - renderApplication renderApplication.js:54:5
35  // - run AppRegistry.js:117:26
36  //
37  if (process.env.EXPO_USE_FB_SOURCES) {
38    return (0, _importMetroFromProject().importMetroSourceMapFromProject)(projectRoot).generateFunctionMap(ast, context);
39  }
40
41  return null;
42}
43//# sourceMappingURL=generateFunctionMap.js.map