text: /* eslint-disable import/no-extraneous-dependencies */
  const path = require('path');
  const autoprefixer = require('autoprefixer');
  const HtmlWebpackPlugin = require('html-webpack-plugin');
  const { CleanWebpackPlugin } = require('clean-webpack-plugin');
  
  const baseURL = path.resolve(__dirname, '..');
  
  module.exports = {
    entry: ['babel-polyfill', path.resolve(baseURL, 'src', 'index.js')],
    output: {
      path: path.resolve(baseURL, 'dist'),
      filename: 'bundle.js',
      chunkFilename: '[id].js',
      publicPath: '',
    },
    resolve: {
      extensions: ['.js', '.jsx'],
    },
    module: {
      rules: [
        {
          test: /\.js$/,
          loader: 'babel-loader',
          exclude: /node_modules/,
        },
        {
          test: /\.s[ac]ss$/i,
          exclude: /node_modules/,
          use: [
            { loader: 'style-loader' },
            {
              loader: 'css-loader',
              options: {
                sourceMap: true,
              },
            },
            'sass-loader',
            {
              loader: 'postcss-loader',
              options: {
                ident: 'postcss',
                plugins: () => [
                  autoprefixer({}),
                ],
              },
            },
          ],
        },
        {
          test: /\.(png|jpe?g|gif)$/,
          loader: 'url-loader?limit=10000&name=img/[name].[ext]',
        },
      ],
    },
    plugins: [
      new CleanWebpackPlugin(),
      new HtmlWebpackPlugin({
        template: `${baseURL}/src/index.html`,
        filename: 'index.html',
        inject: 'body',
      }),
    ],
  };
  