text: import { resolve } from 'path';
  import ESLintPlugin from 'eslint-webpack-plugin';
  import TerserPlugin from 'terser-webpack-plugin';
  import { CleanWebpackPlugin as CleanPlugin } from 'clean-webpack-plugin';
  
  const dev = process.env.NODE_ENV === 'development';
  
  const plugins = [new CleanPlugin(), new ESLintPlugin()];
  
  export default {
    mode: dev ? 'development' : 'production',
    devtool: dev ? 'eval-cheap-module-source-map' : 'cheap-module-source-map',
    entry: './src/index.js',
    module: {
      rules: [
        {
          test: /\.js$/,
          exclude: /node_modules/,
          use: ['babel-loader']
        }
      ]
    },
    output: {
      path: resolve(__dirname, 'dist'),
      filename: 'index.js'
    },
    plugins,
    resolve: {
      extensions: ['.js', '.json'],
      modules: ['node_modules', 'src'],
      alias: {
        components: resolve(__dirname, 'src/components')
      }
    },
    optimization: {
      minimizer: [
        new TerserPlugin({
          terserOptions: {
            ecma: 9
          }
        })
      ]
    },
    externals: {
      geopattern: 'GeoPattern'
    }
  };
  