"use strict";

var _interopRequireWildcard = require("@babel/runtime-corejs3/helpers/interopRequireWildcard");

var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");

var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");

_Object$defineProperty(exports, "__esModule", {
  value: true
});

exports.default = void 0;

var _path = require("path");

var _webpack = _interopRequireDefault(require("webpack"));

var _webpackMerge = _interopRequireDefault(require("webpack-merge"));

var _copyWebpackPlugin = _interopRequireDefault(require("copy-webpack-plugin"));

var _yargs = require("yargs");

var _extendWebpackConfig = _interopRequireDefault(require("../../utils/extendWebpackConfig"));

var _babelDefine = _interopRequireDefault(require("../../babel-define"));

var plugins = _interopRequireWildcard(require("./webpack.plugins"));

var _webpack3 = _interopRequireWildcard(require("./webpack.config"));

// import OptimizeCssAssetsPlugin from 'optimize-css-assets-webpack-plugin'
// import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer'
const configPlugins = [new _webpack.default.DefinePlugin((0, _babelDefine.default)('production')), // new webpack.optimize.AggressiveMergingPlugin({ minSizeReduce: 1.0 }),
new _copyWebpackPlugin.default([{
  from: (0, _path.resolve)(_webpack3.CWD, 'web.config'),
  to: (0, _path.resolve)(_webpack3.CWD, '_dist')
}])];
const config = (0, _webpackMerge.default)(_webpack3.default, {
  devtool: 'source-map',
  plugins: configPlugins,
  mode: 'production'
});

var _default = (0, _extendWebpackConfig.default)(config, _webpack3.ROOT_PATH, plugins);

exports.default = _default;
module.exports = exports.default;