text: const path = require('path')
  const webpack = require('webpack')
  
  const config = (env, argv) => {
    console.log('argv', argv.mode)
  
    return {
      entry: './src/index.js',
      output: {
        path: path.resolve(__dirname, 'build'),
        filename: 'main.js'
      },
      devServer: {
        contentBase: path.resolve(__dirname, 'build'),
        compress: true,
        port: 3000,
      },
      devtool: 'source-map',
      module: {
        rules: [
          {
            test: /\.js$/,
            loader: 'babel-loader',
            query: {
              presets: ['@babel/preset-react', '@babel/preset-env'],
            },
          },
          {
            test: /\.css$/,
            loaders: ['style-loader', 'css-loader'],
          },
        ],
      }
    }
  }
  
  module.exports = config