text: const webpack = require('webpack'),
      HtmlWebpackPlugin = require('html-webpack-plugin'),
      ExtractTextPlugin = require('extract-text-webpack-plugin'),
      helpers = require('./helpers'),
      config = require('./app.config.json');
  
  ENV = process.env.ENV = process.env.NODE_ENV = 'development';
  
  
  module.exports = {
      entry: {
          'polyfills': './src/polyfills.ts',
          'vendor': './src/vendor.ts',
          'app': './src/main.ts'
      },
  
      resolve: {
          extensions: ['.ts', '.js']
      },
  
      module: {
          rules: [
              {
                  test: /\.ts$/,
                  loaders: [
                      {
                          loader: 'awesome-typescript-loader',
                          options: { configFileName: helpers.root('src', 'tsconfig.json') }
                      } , 'angular2-template-loader'
                  ]
              },
              {
                  test: /\.html$/,
                  loader: 'html-loader'
              },
              {
                  test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/,
                  loader: 'file-loader?name=assets/[name].[hash].[ext]'
              },
              {
                  test: /\.css$/,
                  exclude: helpers.root('src', 'app'),
                  loader: ExtractTextPlugin.extract({ fallbackLoader: 'style-loader', loader: 'css-loader?sourceMap' })
              },
              {
                  test: /\.scss$/,
                  loader: ExtractTextPlugin.extract({ fallbackLoader: 'style-loader', loader: 'css-loader?sourceMap!sass-loader?sourceMap' })
              }
          ]
      },
  
      plugins: [
  
          new webpack.ContextReplacementPlugin(/\@angular(\\|\/)core(\\|\/)esm5/,  helpers.root('./src')),
  
          new webpack.DefinePlugin({
              'process.env': {
                  'ENV': JSON.stringify(ENV),
                  'config': JSON.stringify(config)
              }
          }),
  
          new webpack.optimize.CommonsChunkPlugin({
              name: ['app', 'vendor', 'polyfills']
          }),
  
          new HtmlWebpackPlugin({
              template: 'src/index.html',
              hash: false
          }),
  
          new webpack.ProvidePlugin({
              jQuery: 'jquery',
              $: 'jquery',
              jquery: 'jquery',
              charts: 'charts.js'
          })
      ]
  };
  