text: const path = require('path')
  const CleanWebpackPlugin = require('clean-webpack-plugin')
  
  module.exports = {
    mode: 'production',
    entry: {
      index: './src/index.js',
    },
    output: {
      path: path.resolve(__dirname, '../lib'),
      filename: '[name].js',
      libraryTarget: 'commonjs2',
    },
    module: {
      rules: [
        {
          test: /\.js$/,
          loader: 'babel-loader',
          exclude: /node_modules/,
        },
        {
          test: /\.css$/,
          use: [
            'style-loader',
            {
              loader: 'css-loader',
              options: {
                modules: true,
                camelCase: true,
                localIdentName: '[name]__[local]--[hash:base64:5]',
              },
            },
            'postcss-loader',
          ],
        },
        {
          test: /\.(jpe?g|png|svg|bmp)$/,
          loader: 'file-loader',
          options: {
            outputPath: 'images/',
            publicPath: '/lib/images/',
            name: '[name].[ext]',
          },
        },
      ],
    },
    plugins: [
      new CleanWebpackPlugin(['lib']),
    ],
  }
  