text: const webpack = require('webpack');
  const conf = require('./gulp.conf');
  const path = require('path');
  
  const HtmlWebpackPlugin = require('html-webpack-plugin');
  const FailPlugin = require('webpack-fail-plugin');
  const ExtractTextPlugin = require('extract-text-webpack-plugin');
  const pkg = require('../package.json');
  const autoprefixer = require('autoprefixer');
  
  module.exports = {
    module: {
      loaders: [
        {
          test: /\.json$/,
          loaders: [
            'json-loader'
          ]
        },
        {
          test: /\.js$/,
          exclude: /node_modules/,
          loader: 'eslint-loader',
          enforce: 'pre'
        },
        {
          test: /\.(css|scss)$/,
          loaders: ExtractTextPlugin.extract({
            fallback: 'style-loader',
            use: 'css-loader?minimize!sass-loader!postcss-loader'
          })
        },
        {
          test: /\.(png|jpg|svg)$/,
          exclude: /node_modules/,
          loader: 'url-loader?limit=8192'
        },
        {
          test: /\.js$/,
          exclude: /node_modules/,
          loaders: [
            'ng-annotate-loader',
            'babel-loader'
          ]
        },
        {
          test: /\.html$/,
          loaders: [
            'html-loader?' + JSON.stringify({
              attrs: ['img:src', 'img:ng-src']
            })
          ]
        }
      ]
    },
    plugins: [
      new webpack.optimize.OccurrenceOrderPlugin(),
      new webpack.NoEmitOnErrorsPlugin(),
      FailPlugin,
      new webpack.DefinePlugin({
        PRODUCTION: JSON.stringify(true),
        API_URL: JSON.stringify('')
      }),
      new HtmlWebpackPlugin({
        template: conf.path.src('index.html')
      }),
      new webpack.optimize.UglifyJsPlugin({
        mangle: false,
        output: {comments: false},
        compress: {unused: false, dead_code: false, warnings: false} // eslint-disable-line camelcase
      }),
      new ExtractTextPlugin('index-[contenthash].css'),
      new webpack.optimize.CommonsChunkPlugin({name: 'vendor'}),
      new webpack.LoaderOptionsPlugin({
        options: {
          postcss: () => [autoprefixer]
        }
      })
    ],
    output: {
      path: path.join(process.cwd(), conf.paths.dist),
      filename: '[name]-[hash].js'
    },
    entry: {
      app: `./${conf.path.src('index')}`,
      vendor: Object.keys(pkg.dependencies)
    }
  };
  