"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.createWebsiteAppConfig = void 0;
var _createReactAppConfig = require("./createReactAppConfig");
const createWebsiteAppConfig = modifier => {
  return (0, _createReactAppConfig.createReactAppConfig)(baseParams => {
    const {
      config,
      options
    } = baseParams;
    config.customEnv(env => ({
      ...env,
      PORT: process.env.PORT || 3000,
      WEBINY_WEBSITE_ENV: options.env
    }));
    config.pulumiOutputToEnv("apps/api", ({
      output,
      env
    }) => {
      if (!output) {
        return env;
      }
      return {
        ...env,
        REACT_APP_GRAPHQL_API_URL: `${output.apiUrl}/graphql`,
        REACT_APP_API_URL: output.apiUrl
      };
    });
    if (modifier) {
      modifier(baseParams);
    }
  });
};
exports.createWebsiteAppConfig = createWebsiteAppConfig;

//# sourceMappingURL=createWebsiteAppConfig.js.map