text: const path = require('path');
  const webpack = require('webpack');
  const autoprefixer = require('autoprefixer');
  const MiniCssExtractPlugin = require('mini-css-extract-plugin');
  const { getFeatureFlags } = require('./webpack-utils');
  
  module.exports = {
    mode: 'development',
    entry: './frontend/main.jsx',
    devtool: 'inline-source-map',
    devServer: {
      contentBase: './dist',
    },
    output: {
      filename: 'bundle.js',
      path: path.resolve(__dirname, 'dist'),
      publicPath: '/dist/',
    },
    resolve: {
      extensions: ['.js', '.jsx'],
    },
    module: {
      rules: [
        {
          test: /\.jsx?$/,
          exclude: /(node_modules|bower_components|public\/)/,
          loader: 'babel-loader',
        },
        {
          test: /\.scss$/,
          use: [
            MiniCssExtractPlugin.loader,
            {
              loader: 'css-loader',
              options: {
                url: url => !url.includes('images'),
              },
            },
            {
              loader: 'postcss-loader',
              options: {
                sourceMap: true,
                plugins: [autoprefixer],
              },
            },
            'sass-loader',
          ],
        },
        {
          test: /\.(gif|png|jpe?g|ttf|woff2?|eot)$/i,
          loader: 'file-loader',
          options: {
            name: 'images/[hash].[ext]',
          },
        },
        {
          test: /\.svg$/i,
          oneOf: [
            {
              // For .svg files in public/images/icons/, use the react-svg loader
              // so that they can be loaded as React components
              include: path.resolve(__dirname, 'public/images/icons'),
              use: [
                'babel-loader',
                {
                  loader: 'react-svg-loader',
                  options: {
                    svgo: {
                      plugins: [{ removeViewBox: false }],
                    },
                  },
                },
              ],
            },
            {
              // For all other .svg files, fallback to the file-loader
              loader: 'file-loader',
              options: {
                name: 'images/[hash].[ext]',
              },
            },
          ],
        },
      ],
    },
    plugins: [
      // Make sure this is the first plugin!!!
      new MiniCssExtractPlugin({ filename: 'styles.css' }),
      // When webpack bundles moment, it includes all of its locale files,
      // which we don't need, so we'll use this plugin to keep them out of the
      // bundle
      new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
      new webpack.DefinePlugin(getFeatureFlags(process.env)),
    ],
  };
  