"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = createWebpackConfig;
function _path() {
  const data = _interopRequireDefault(require("path"));
  _path = function () {
    return data;
  };
  return data;
}
function _webpackMerge() {
  const data = require("webpack-merge");
  _webpackMerge = function () {
    return data;
  };
  return data;
}
function _webpackBase() {
  const data = _interopRequireDefault(require("./webpack.base.config"));
  _webpackBase = function () {
    return data;
  };
  return data;
}
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
function createWebpackConfig(workspaceDir, entryFiles, publicDir) {
  const baseConfig = (0, _webpackBase().default)(workspaceDir, entryFiles);
  const ssrConfig = createSsrConfig(workspaceDir, publicDir);
  const combined = (0, _webpackMerge().merge)(baseConfig, ssrConfig);
  return combined;
}
function createSsrConfig(workspaceDir, publicDir) {
  const ssrConfig = {
    target: 'node',
    devtool: 'eval-cheap-module-source-map',
    output: {
      path: _path().default.resolve(workspaceDir, publicDir, 'ssr'),
      publicPath: '/public/ssr/',
      libraryTarget: 'commonjs',
      filename: 'index.js',
      chunkFilename: 'static/js/[name].[contenthash:8].chunk.js'
    }
  };
  return ssrConfig;
}

//# sourceMappingURL=webpack.ssr.config.js.map