"use strict";

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

var _corsHandleing = require("./corsHandleing");

var _initExpressApp = require("./initExpressApp");

var _configWebpackDevMiddleware = require("./configWebpackDevMiddleware");

var _serveContextFiles = require("./serveContextFiles");

var _startHttpsServer = require("./startHttpsServer");

var _initialHTMLHandling = require("./initialHTMLHandling");

var _startHttpServer = require("./startHttpServer");

// import c from './bundler/webpack/webpack.dev.config.js'
// import { spawnSyncIO } from '../commands-utlis/spanSync';
// import { startHttpServer } from './startHttpServer';
function run(options) {
  const app = (0, _initExpressApp.initExpressApp)();
  (0, _corsHandleing.corsHandleing)(app, options);
  const {
    compiler
  } = (0, _configWebpackDevMiddleware.configWebpackDevMiddleware)(app, options);
  (0, _serveContextFiles.serveContextFiles)(app, options);
  (0, _startHttpsServer.startHttpsServer)(app, options);
  (0, _startHttpServer.startHttpServer)(app, options);
  (0, _initialHTMLHandling.initialHTMLHandling)(compiler, app, options); // return spawnSyncIO('webpack', [
  //   'serve',
  //   '--config',
  //   require.resolve('../bundler/webpack/webpack.dev.config.js')
  // ]);
  // startHttpServer(app, options);
}