let webpack = require('webpack'),
    CleanWebpackPlugin = require('clean-webpack-plugin'),
    PACKAGE = require('./package.json'),
    banner = `/**
 * Angular X Showdown Module (https://github.com/yisraelx/ngx-showdown)
 * @version ${PACKAGE.version}
 * @license MIT (https://github.com/yisraelx/ngx-showdown/blob/master/LICENSE)
 * @copyright Yisrael Eliav <yisraelx@gmail.com> (https://github.com/yisraelx)
 */`;

module.exports = {

    entry: {
        'ngx-showdown.umd': './src/index.ts',
        'ngx-showdown.umd.min': './src/index.ts'
    },

    output: {
        path: __dirname + '/bundles',
        filename: '[name].js',
        libraryTarget: 'umd',
        library: ['ng', 'showdown'],
        umdNamedDefine: false
    },

    resolve: {
        extensions: ['.js', '.ts']
    },

    plugins: [
        new CleanWebpackPlugin('./bundles'),
        new webpack.optimize.UglifyJsPlugin({
            include: /\.min\.js$/, minimize: true
        }),
        new webpack.BannerPlugin({banner, raw: true, entryOnly: true})
    ],

    module: {
        rules: [
            {
                test: /\.ts$/,
                loader: 'ts-loader',
                options: {
                    compilerOptions: {
                        declaration: false
                    }
                }

            }
        ]
    },

    externals: {
        '@angular/core': {
            root: ['ng', 'core'],
            amd: '@angular/core',
            commonjs: '@angular/core',
            commonjs2: '@angular/core'
        },
        '@angular/http': {
            root: ['ng', 'http'],
            amd: '@angular/http',
            commonjs: '@angular/http',
            commonjs2: '@angular/http'
        },
        'showdown': 'showdown'
    }

};
@@ -1551,24 +1551,31 @@
   '@angular/
+common/
 http': %7B%0A   
@@ -1595,16 +1595,26 @@
 : %5B'ng',
+ 'common',
  'http'%5D
@@ -1634,32 +1634,39 @@
  amd: '@angular/
+common/
 http',%0A         
@@ -1684,24 +1684,31 @@
 : '@angular/
+common/
 http',%0A     
@@ -1735,16 +1735,23 @@
 angular/
+common/
 http'%0A  

repair of the umd bundle (package.browser)