text: const { CleanWebpackPlugin } = require('clean-webpack-plugin');
  const MiniCssExtractPlugin = require('mini-css-extract-plugin');
  const MediaQuerySplittingPlugin = require('media-query-splitting-plugin');
  const HtmlWebPackPlugin = require("html-webpack-plugin");
  const OfflinePlugin = require('offline-plugin');
  
  module.exports = {
    plugins: [
      new CleanWebpackPlugin(),
      new MiniCssExtractPlugin({
        filename: '[name].[hash].css',
        chunkFilename: '[id].[hash].css',
      }),
      new MediaQuerySplittingPlugin(),
      new HtmlWebPackPlugin({
        filename: "index.html",
        template: "source/index.html"
      }),
      new OfflinePlugin()
    ],
    module: {
      rules: [
        {
          test: /\.imba$/,
          loader: 'imba/loader',
        },
        {
          test: /\.html$/,
          use: [
            {
              loader: "html-loader",
              options: { minimize: true }
            }
          ]
        },
        {
          test: /\.(sa|sc|c)ss$/,
          use: [
            {
              loader: MiniCssExtractPlugin.loader,
              options: {
                hmr: process.env.NODE_ENV === 'development',
              },
            },
            'css-loader',
            'sass-loader',
          ],
        },
      ],
    },
    devServer: {
      historyApiFallback: true,
    },
    resolve: {
      extensions: [".imba", ".js", ".json", ".scss"]
    },
    entry: ["./source/index.imba", "./source/index.scss", "./source/index.html"],
    output: {  path: __dirname + '/public', filename: '[name].[contenthash].js' },
    optimization: {
      moduleIds: 'hashed',
      runtimeChunk: 'single',
      splitChunks: {
        cacheGroups: {
          vendor: {
            test: /[\\/]node_modules[\\/]/,
            name: 'vendors',
            chunks: 'all'
          }
        }
      }
    }
  }