text: const { environment } = require('@rails/webpacker');
  const dotenv = require('dotenv');
  const webpack = require('webpack');
  
  dotenv.config({ silent: true });
  
  environment.plugins.prepend(
    'Environment',
    new webpack.EnvironmentPlugin(JSON.parse(JSON.stringify(process.env)))
  );
  
  environment.plugins.prepend(
    'Provide',
    new webpack.ProvidePlugin({
      $: 'jquery/src/jquery',
      jQuery: 'jquery/src/jquery',
      'window.jQuery': 'jquery'
    })
  );
  
  const nodeModulesLoader = environment.loaders.get('nodeModules');
  if (!Array.isArray(nodeModulesLoader.exclude)) {
    nodeModulesLoader.exclude = nodeModulesLoader.exclude == null ? [] : [nodeModulesLoader.exclude];
  }
  nodeModulesLoader.exclude.push(/mapbox-gl|layer-manager/);
  
  module.exports = environment;
  