text: /* eslint-disable import/no-extraneous-dependencies */
  const path = require('path');
  const HtmlWebpackPlugin = require('html-webpack-plugin');
  const MiniCssExtractPlugin = require('mini-css-extract-plugin');
  const CopyWebpackPlugin = require('copy-webpack-plugin');
  const FaviconsWebpackPlugin = require('favicons-webpack-plugin');
  
  module.exports = {
    entry: {
      app: './_src/index.js',
    },
    plugins: [
      new FaviconsWebpackPlugin({
        logo: './_images/icon.png',
      }),
      new HtmlWebpackPlugin({
        template: './_src/template/default.html',
        filename: '../_layouts/default.html',
      }),
      new MiniCssExtractPlugin({ filename: '[name].css' }),
      new CopyWebpackPlugin({
        patterns: [
          {
            from: path.resolve('_images'),
            to: 'images/',
          },
          {
            from: path.resolve('_files'),
            to: 'files/',
          },
        ],
      }),
    ],
    module: {
      rules: [
        {
          test: /\.js$/,
          exclude: /(node_modules|bower_components)/,
          use: {
            loader: 'babel-loader',
            options: {
              presets: ['env'],
            },
          },
        },
        {
          test: /\.(sa|sc|c)ss$/,
          use: [
            MiniCssExtractPlugin.loader,
            'css-loader',
            'postcss-loader',
            'sass-loader',
          ],
        },
        // {
        //   test: /\.(css|scss)$/,
        //   use: ExtractTextPlugin.extract({
        //     fallback: 'style-loader',
        //     use: [
        //       { loader: 'css-loader', options: { importLoaders: 1 } },
        //       {
        //         loader: 'postcss-loader',
        //         options: {
        //           config: {
        //             path: 'config/postcss.config.js',
        //           },
        //         },
        //       },
        //       { loader: 'sass-loader' },
        //     ],
        //   }),
        // },
        {
          test: /\.(png|svg|jpg|gif)$/,
          use: ['file-loader'],
        },
        {
          test: /\.(woff|woff2|eot|ttf|otf)$/,
          use: ['file-loader'],
        },
      ],
    },
  };
  