text: const path = require('path'),
      webpack = require('webpack'),
      HtmlWebpackPlugin = require('html-webpack-plugin'),
      ExtractTextPlugin = require('extract-text-webpack-plugin'),
      CopyWebpackPlugin = require('copy-webpack-plugin');
  
  // to extract multiple CSS
  const mainCSS = new ExtractTextPlugin('assets/styles/main.min.css'),
      subCSS = new ExtractTextPlugin('assets/styles/style.min.css')
  
  module.exports = {
      entry: ['./src/index.js', './src/assets/styles/main.scss'],
      output: {
          filename: 'assets/js/main.js',
          path: path.resolve(__dirname, 'dist')
      },
      devtool: 'source-map',
      module: {
          loaders: [
              {
                  test: /\.(js|jsx)$/,
                  loader: 'babel-loader',
                  exclude: /node_modules/
                  // query: {
                  //     presets: ['es2015', 'react']
                  // }
              },
              {
                  test: /\.js$/,
                  exclude: /node_modules/,
                  loader: 'eslint-loader'
              },
              {
                  test: /\.scss$/,
                  exclude: [/node_modules/, path.resolve(__dirname, 'src/assets/scss')],
                  use: mainCSS.extract({
                      fallback: 'style-loader',
                      use: ['css-loader', 'resolve-url-loader', 'sass-loader?sourceMap']
                  })
              },
              {
                  test: /\.scss$/,
                  include: path.resolve(__dirname, 'src/assets/scss'),
                  use: subCSS.extract({
                      fallback: 'style-loader',
                      use: ['css-loader', 'resolve-url-loader', 'sass-loader?sourceMap']
                  })
              },
              {
                  test: /\.(ico|jpg|jpeg|png|gif|svg)(\?.*)?$/,
                  loader: 'file-loader',
                  options: {
                      publicPath: '../../',
                      name: 'assets/images/[name].[ext]',
                      limit: 10000
                  }
              }
          ]
      },
      plugins: [
          new HtmlWebpackPlugin({
              template: './src/index.html'
          }),
          mainCSS,
          subCSS,
          new webpack.HotModuleReplacementPlugin(),
          new webpack.NamedModulesPlugin(),
          new CopyWebpackPlugin([{from: './src/manifest.json'}]),
          new CopyWebpackPlugin([{
              context: './src/assets/images',
              from: '**/*',
              to: 'assets/images'
          }])
      ],
      devServer: {
          compress: true,
          contentBase: path.join(__dirname, 'dist'),
          historyApiFallback: true,
          hot: true
      }
  };
  