text: const path = require("path")
  const FriendlyErrorsPlugin = require("friendly-errors-webpack-plugin")
  const CopyWebpackPlugin = require("copy-webpack-plugin")
  const HtmlWebpackPlugin = require("html-webpack-plugin")
  
  module.exports = {
    output: {
      filename: "js/[name].bundle.js",
      path: path.resolve(__dirname, "./web/build"),
      publicPath: "/build/"
    },
  
    module: {
      rules: [
        {
          test: /\.js$/,
          loader: "babel-loader",
          exclude: /node_modules/
        },
        {
          test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
          loader: "file-loader",
          options: {
            limit: 10000,
            name: "img/[name].[hash:7].[ext]"
          }
        },
        {
          test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
          loader: "file-loader",
          options: {
            limit: 10000,
            name: "media/[name].[hash:7].[ext]"
          }
        },
        {
          test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
          loader: "file-loader",
          options: {
            limit: 10000,
            name: "fonts/[name].[hash:7].[ext]"
          }
        }
      ]
    },
  
    plugins: [
      // Generates a TWIG file that includes all your webpack
      // bundles in the body using style and script tags
      new HtmlWebpackPlugin({
        template: "./src/templates/_layout.twig",
        filename: "../../templates/_layout.twig"
      }),
  
      // Copy static assets
      new CopyWebpackPlugin([
        {
          from: path.resolve(__dirname, "./static"),
          to: "static",
          ignore: [".*"]
        }
      ]),
  
      new FriendlyErrorsPlugin()
    ]
  }
  