"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = _default;

function _react() {
  const data = _interopRequireDefault(require("react"));

  _react = function _react() {
    return data;
  };

  return data;
}

function _path() {
  const data = require("path");

  _path = function _path() {
    return data;
  };

  return data;
}

function _fs() {
  const data = require("fs");

  _fs = function _fs() {
    return data;
  };

  return data;
}

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _default(api) {
  const paths = api.service.paths;
  const globalFiles = [(0, _path().join)(paths.absSrcPath, 'global.tsx'), (0, _path().join)(paths.absSrcPath, 'global.ts'), (0, _path().join)(paths.absSrcPath, 'global.jsx'), (0, _path().join)(paths.absSrcPath, 'global.js')];
  api.addEntryImportAhead(() => {
    return globalFiles.filter(f => (0, _fs().existsSync)(f)).slice(0, 1).map(f => ({
      source: (0, _path().relative)(paths.absTmpDirPath, f)
    }));
  });
  api.addPageWatcher(globalFiles);
}