const path = require('path');
const CopyPlugin = require('copy-webpack-plugin');

module.exports = {
  mode: 'development',
  entry: './frontend/index.js', // Ensure this entry point exists and is valid.
  plugins: [
    new CopyPlugin({
      patterns: [
        // Copy Bootstrap's CSS and JS from node_modules to your desired location
        { from: 'node_modules/bootstrap/dist', to: path.resolve(__dirname, 'static/bootstrap5') },
        { from: 'node_modules/leaflet/dist', to: path.resolve(__dirname, 'static/leaflet') },
        { from: 'node_modules/leaflet.geodesic/dist', to: path.resolve(__dirname, 'static/leaflet-geodesic'), },
        { from: 'node_modules/es-module-shims/dist', to: path.resolve(__dirname, 'static/es-module-shims') }
      ],
    }),
  ]
};