"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const webpack_merge_1 = __importDefault(require("webpack-merge"));
const useOwn_1 = __importDefault(require("../../scripts/useOwn"));
// const removeNil = Utils.removeNil;
/**
 * Hot Module Replacement support
 * @param config
 * @param builder
 */
const HotModuleReplacement = () => (config, _builder) => {
    return webpack_merge_1.default.strategy({
        entry: 'prepend',
        'entry.index': 'prepend'
    })(config, {
        // entry: {
        // 	index: removeNil([
        // 		// Extends hot reloading with the ability to hot path React Components.
        // 		// This should always be at the top of your entries list. Only put
        // 		// polyfills above it.
        // 		builder.ifDevClient(useOwn('react-hot-loader/patch')),
        // 		// Required to support hot reloading of our client.
        // 		builder.ifDevClient(
        // 			() =>
        // 				`${useOwn('webpack-hot-middleware/client')}?reload=true`,
        // 				// tslint:disable-next-line:max-line-length
        // 				// `${useOwn('webpack-hot-middleware/client')}?reload=true&path=http:
        // //${builder.configs.host}:${builder.configs.clientDevServerPort}/__webpack_hmr`,
        // 		),
        // 	])
        // },
        // plugins: removeNil([
        // 	// We need this plugin to enable hot reloading of our client.
        // 	builder.ifDevClient(() => new HotModuleReplacementPlugin({
        // 		// multiStep: true,
        // 	})),
        // ]),
        resolve: {
            alias: {
                'react-hot-loader': useOwn_1.default('react-hot-loader'),
                'webpack-hot-client': useOwn_1.default('webpack-hot-client'),
            },
        },
    });
};
exports.default = HotModuleReplacement;
//# sourceMappingURL=HotModuleReplacement.js.map