Webpack production build does not load anything
<p>I've been working on an app using React and Webpack for a little while. My development environment works fine, and everything loads properly using webpack-dev-server.</p>

<p>I decided to run a production build of the application to see what the end-product might look like size-wise and observe the general output of the webpack product build.</p>

<p>It turns out that running <code>webpack -p</code>, while it does produce output (more on that in a minute), does not load anything at all when I hit the site in a browser.. A quick check of the output tells me that none of my component code is making it into the <code>webpack -p</code> build.</p>

<p>The images and HTML copy over as they exist in my src (dev) folder, however my JS bundle output is extremely small - the file (main.js) is only 246 bytes.</p>

<p>Here is the output from running webpack -p</p>

<pre><code>$ npm run build

&gt; project@0.1.0 build /Users/me/Development/project
&gt; NODE_ENV=production webpack -p --bail --progress --config webpack.config.babel.js

Hash: 9e5f6974ce21c920a375
Version: webpack 1.12.10
Time: 2003ms
            Asset       Size  Chunks             Chunk Names
       index.html    1.45 kB          [emitted]
  images/edit.svg  524 bytes          [emitted]
images/search.svg    1.19 kB          [emitted]
          main.js  246 bytes    0, 1  [emitted]  javascript, html
    + 219 hidden modules
</code></pre>

<p>When I run the development version of the project, the output is markedly different... I know that the dev server dependencies are in there, and the code is not minified.. And, most importantly - everything works as expected when running the dev server.</p>

<pre><code>$ npm start

&gt; project@0.1.0 start /Users/me/Development/project
&gt; webpack-dev-server --hot --display-modules --config webpack.config.babel.js

http://localhost:3333/
webpack result is served from /
content is served from /Users/me/Development/project/dist
Hash: 1b34ed58f9e323966ada
Version: webpack 1.12.10
Time: 2745ms
            Asset       Size  Chunks             Chunk Names
       index.html    1.45 kB          [emitted]
  images/edit.svg  524 bytes          [emitted]
images/search.svg    1.19 kB          [emitted]
          main.js    1.54 MB    0, 1  [emitted]  html, javascript
</code></pre>

<p>Here's my webpack.config.babel.js file:</p>

<pre><code>import webpack from 'webpack';
import path from 'path';

import ModernizrWebpackPlugin from 'modernizr-webpack-plugin';
import modernizrConfig from './modernizr.config';

const appDir = path.resolve(__dirname, './src');
const distDir = path.resolve(__dirname, './dist');
const nodeModulesDir = path.resolve(__dirname, './node_modules');

const excludeDirs = /(node_modules|bower_components)/;

module.exports = {
    entry: {
        javascript: appDir + '/main.js',
        html: appDir + '/index.html'
    },
    output: {
        path: distDir,
        filename: 'main.js',
    },
    devServer: {
        contentBase: distDir,
        inline: true,
        port: 3333
    },
    resolve: {
        extensions: ['', '.js', '.es6'],
        modulesDirectories: [
            'node_modules',
            './src'
        ]
    },
    plugins: [
        // new webpack.optimize.CommonsChunkPlugin('common.js'),
        // new ModernizrWebpackPlugin(modernizrConfig),
    ],
    sassLoader: {
        sourceMap: false,
        includePaths: [
            appDir,
            nodeModulesDir,
            nodeModulesDir + '/breakpoint-sass/stylesheets/',
            nodeModulesDir + '/susy/sass'
        ]
    },
    module: {
        loaders: [
            { // js/jsx
                test: /\.js?$/,
                exclude: excludeDirs,
                loader: 'babel',
                query: {
                    cacheDirectory: true,
                    presets: [
                        'es2015', 'react'
                    ]
                }
            },
            { // html
                test: /\.html$/,
                exclude: excludeDirs,
                loader: 'file?name=[name].[ext]'
            },
            { // images
                test: /\.(gif|png|jpg|jpeg|svg)$/,
                exclude: excludeDirs,
                loader: 'file?name=images/[name].[ext]'
            },
            { // sass
                test: /\.scss$/,
                exclude: excludeDirs,
                loader: 'style!css!sass'
            }
        ]
    }
}
</code></pre>

<p>I don't think I've got a particularly complex, or uncommon setup, and I've tried changing everything from es2015/es6 to commonJS already as well, with the same result. </p>

<p>I'm at a loss as to what the issue could possibly be here; hoping that someone can point out some obvious error I've got, or perhaps suggest config updates/changes that could resolve this problem.</p>

<p>Thanks for taking the time to read everything!</p>