text: const path = require('path'),
      webpack = require('webpack'),
      HTMLplugin = require('html-webpack-plugin'),
      MiniCssExtractPlugin = require('mini-css-extract-plugin'),
      UglifyJsPlugin = require('uglifyjs-webpack-plugin'),
      CopyWebpuckPlugin = require('copy-webpack-plugin');
  
  module.exports = {
      // какой модуль собирать (index.js)
      entry: path.resolve(__dirname, 'src', 'index.js'),
      output: {
          // куда выводить сборку (dist)
          path: path.resolve(__dirname, 'dist'),
          filename: 'bundle.js'
      },
      devServer: {
          // настройка сервера
          historyApiFallback: true,
          contentBase: path.resolve(__dirname, 'dist'),
      },
      module: {
          // настройка всех загрузчиков
          rules: [
              {
                  test: /\.jsx?$/,
                  exclude: /node_modules/,
                  use: {
                      loader: 'babel-loader'
                  }
              },
              {
                  test: /\.scss$/,
                  use: [
                      MiniCssExtractPlugin.loader,
                      'css-loader',
                      'postcss-loader',
                      'sass-loader'
                  ],
              },
              {
                  test: /\.(gif|png|jpe?g|svg)$/,
                  use: [
                      {
                          loader: 'file-loader',
                          options: {
                              name: 'images/[name].[ext]'
                          }
                      }
                  ]
              },
              {
                  test: /\.svg$/,
                  use: [
                      {
                          loader: 'svg-inline-loader',
                          options: {
                              name: 'images/[name].[ext]'
                          }
                      }
                  ]
              },
              {
                  test: /\.(woff(2)?|ttf|eot|svg|otf)(\?v=\d+\.\d+\.\d+)?$/,
                  loader: 'file-loader',
                  options: {
                      name: 'fonts/[name].[ext]'
                  }
              }
          ]
      },
      resolve: {
          extensions: ['.js'],
      },
      plugins: [
          new HTMLplugin({
              template: path.resolve(__dirname, 'src', 'index.html'),
              filename: 'index.html'
          }),
          new MiniCssExtractPlugin({
              filename: 'style.css',
          }),
          new CopyWebpuckPlugin([
              {from: 'src/images', to: 'images'}, //копирует файлы
          ]),
          new webpack.ProvidePlugin({
              $: 'jquery',
              jQuery: 'jquery',
              'window.jQuery': 'jquery',
              Poper: 'poper'
          }),
      ],
  };
  