title: Electron webpack issue with selenium-webdriver [bazel-genfiles]
body: <p>For my electron app project <a href="https://github.com/alexdevero/electron-react-webpack-boilerplate" rel="noreferrer">(used boilerplate)</a>, I want to execute a few selenium node commands using <a href="https://www.npmjs.com/package/selenium-webdriver" rel="noreferrer">selenium-webdriver</a> and <a href="https://github.com/giggio/node-chromedriver" rel="noreferrer">chromedriver</a>.</p>
  
  <p>The problem is, when I added the module <code>selenium-webdriver</code>, suddenly my app is throwing error and warning in terminal and console.</p>
  
  <hr>
  
  <p>Terminal warning:</p>
  
  <pre><code>WARNING in ./node_modules/selenium-webdriver/lib/http.js 49:11-26
  Critical dependency: the request of a dependency is an expression
   @ ./node_modules/selenium-webdriver/http/index.js
   @ ./node_modules/selenium-webdriver/index.js
   @ ./src/components/playback.js
   @ ./src/components/App.js
   @ ./src/index.js
  
  WARNING in ./node_modules/selenium-webdriver/lib/http.js
  Module not found: Error: Can't resolve '../../../../bazel-genfiles' in
  '&lt;MY_LOCAL_DIR&gt;/electron-react-webpack-boilerplate/node_modules/selenium-webdriver/lib'
   @ ./node_modules/selenium-webdriver/lib/http.js
   @ ./node_modules/selenium-webdriver/http/index.js
   @ ./node_modules/selenium-webdriver/index.js
   @ ./src/components/playback.js
   @ ./src/components/App.js
   @ ./src/index.js
  </code></pre>
  
  <hr>
  
  <p>Application Error:</p>
  
  <pre><code>Error: Cannot find module 'undefined'
      at webpackMissingModule (http.js:53)
      at requireAtom (http.js:53)
      at Object../node_modules/selenium-webdriver/lib/http.js (http.js:35)
      at __webpack_require__ (bootstrap:685)
      at fn (bootstrap:59)
      at Object../node_modules/selenium-webdriver/http/index.js (index.js:29)
      at __webpack_require__ (bootstrap:685)
      at fn (bootstrap:59)
      at Object../node_modules/selenium-webdriver/index.js (index.js:25)
      at __webpack_require__ (bootstrap:685)
  
  Uncaught Error: Failed to import atoms module ./atoms/get-attribute.js. 
  If running in dev mode, you need to run
  `bazel build //javascript/node/selenium-webdriver/lib/atoms:get-attribute.js`
  from the projectroot: Error: Cannot find module './atoms/get-attribute.js'
      at requireAtom (http.js:56)
      at Object../node_modules/selenium-webdriver/lib/http.js (http.js:35)
      at __webpack_require__ (bootstrap:685)
      at fn (bootstrap:59)
      at Object../node_modules/selenium-webdriver/http/index.js (index.js:29)
      at __webpack_require__ (bootstrap:685)
      at fn (bootstrap:59)
      at Object../node_modules/selenium-webdriver/index.js (index.js:25)
      at __webpack_require__ (bootstrap:685)
      at fn (bootstrap:59)
  </code></pre>
  
  <p><strong>The issue is happening because of the webpack only because I am able to execute both the required libraries from the <a href="https://github.com/electron/electron-quick-start" rel="noreferrer">electron-quick-start</a> code</strong></p>
  
  <hr>
  
  <p>The webpack configuration is as below:</p>
  
  <pre><code>const webpack = require('webpack')
  const path = require('path')
  const HtmlWebpackPlugin = require('html-webpack-plugin')
  const { spawn } = require('child_process')
  
  const defaultInclude = path.resolve(__dirname, 'src')
  
  module.exports = {
    module: {
      rules: [
        {
          test: /\.css$/i,
          use: ['style-loader', 'css-loader'],
        },
        {
          test: /\.(png|jpe?g|gif|svg|eot|ttf|woff|woff2)$/,
          loader: 'url-loader',
          options: {
            limit: 8192,
          },
        },
        {
          test: /\.(js|jsx)$/,
          loader: "babel-loader",
          exclude: /node_modules/
        },
        {
          test: /\.(jpe?g|png|gif)$/,
          use: [{ loader: 'file-loader?name=img/[name]__[hash:base64:5].[ext]' }],
          include: defaultInclude
        }
      ]
    },
    target: 'node',
    plugins: [
      new HtmlWebpackPlugin(),
      new webpack.DefinePlugin({
        'process.env.NODE_ENV': JSON.stringify('development')
      })
    ],
    devtool: 'cheap-source-map',
    devServer: {
      contentBase: path.resolve(__dirname, 'dist'),
      stats: {
        colors: true,
        chunks: false,
        children: false
      },
      before() {
        spawn(
          'electron',
          ['.'],
          { shell: true, env: process.env, stdio: 'inherit' }
        )
        .on('close', code =&gt; process.exit(0))
        .on('error', spawnError =&gt; console.error(spawnError))
      }
    }
  }
  </code></pre>