text: const path = require('path');
  const webpack = require('webpack');
  const MiniCssExtractPlugin = require('mini-css-extract-plugin');
  
  module.exports = (dir) => ({
  	output: {
  		filename: 'static/js/[name].[contenthash:8].js',
  		assetModuleFilename: 'assets/images/[hash][ext][query]',
  		chunkFilename: 'static/js/[name].[contenthash:8].js',
  	},
  	module: {
  		rules: [
  			{
  				test: /\.(js|jsx)$/,
  				use: ['babel-loader'],
  			},
  			{
  				test: /\.(css|scss)$/,
  				use: [MiniCssExtractPlugin.loader, 'css-loader', 'sass-loader'],
  			},
  			{
  				test: /\.html$/,
  				use: ['html-loader'],
  			},
  		],
  	},
  	plugins: [
  		new webpack.ProvidePlugin({
  			Buffer: ['buffer', 'Buffer'],
  		}),
  		new webpack.ProvidePlugin({
  			process: 'process/browser',
  		}),
  		new MiniCssExtractPlugin({
  			filename: 'assets/css/[name].css',
  		}),
  		new webpack.ProgressPlugin(),
  		new webpack.DefinePlugin({
  			'process.env': JSON.stringify(process.env),
  		}),
  	],
  	resolve: {
  		extensions: ['.js', '.jsx'],
  		alias: {
  			assets: path.resolve(dir, 'src/assets'),
  		},
  	},
  });
  