title: How do i prevent a .js file being bundled by webpack
body: <p>Hi I am currently using webpack to bundle my project files into a single file.  However, I do not want webpack to bundle my config.js file where all my config is set.  I would like to this remain separate in the output folder but not sure out to achieve this.</p>
  
  <p>my current setup is</p>
  
  <pre><code>//index.js file
  #!/usr/bin/env node
  'use strict';
  let config = require('config.js);
  let read = require('read.js);
  console.log('i am running through command line');
  
  //read.js file
  'use strict'
  console.log('read a text file');
  
  //config.js 
  'use strict';
  module.exports = {
  name: 'test'
  }
  
  //webpack.config.js
  let webpack = require('webpack');
  let path = require('path');
  let fs = require('fs');
  
  let nodeModules = {};
  fs.readdirSync('node_modules')
  .filter(function (x) {
      return [ '.bin' ].indexOf(x) === -1;
  })
  .forEach(function (mod) {
      nodeModules[mod] = 'commonjs ' + mod;
  });
  
  module.exports = {
  entry: [ 'babel-polyfill', './index.js' ],
  target: 'node',
  node: {
      __dirname: true
  },
  output: {
      path: path.join(__dirname, 'webpack_bundle'),
      filename: '[name].js',
      libraryTarget: 'commonjs'
  },
  module: {
      loaders: [
          {
              test: /\.js$/,
              loader: 'shebang-loader'
          },
          {
              test: /\.js$/,
              loader: 'babel-loader',
              query: {
                  presets: [ 'es2015' ]
              }
          } ]
  },
  resolve: {
      extensions: [ '.js' ]
  },
  plugins: [
      new webpack.BannerPlugin({banner: '#!/usr/bin/env node', raw: true 
  })
  ]
  ,
      externals: nodeModules
  };
  </code></pre>
  
  <p>Note: I have significantly simplified the code example for brevity</p>
  
  <p>Currently when i run the <code>webpack</code> command i get a folder <code>webpack_bundle</code> which contains an <code>index.js</code> file - the index.js file includes the dependencies <code>config.js</code> and <code>read.js</code>.  However, what i would like is for the <code>read.js</code> dependency to be bundled into the <code>index.js</code> file but the <code>config.js</code> dependency to stay external in a separate file which gets required by the bundled webpack output.  So the folder <code>webpack_bundle</code> should contain two files after running the <code>webpack</code> command - <code>index.js</code> and <code>config.js</code>. I have already tried to modify the externals by adding the following key value to the externals object <code>config: './config.js'</code> but this did not work. I also created an extra entrypoint by specifying config.js as the entrypoint but this also did not work. I can't figure this out and the webpack docs are not that clear on how to achieve this. Please help!</p>