Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

DIJITUL UK
DIJITUL UK
17,246 Points

When I run webpack, all of node_modules builds even though its ignored

Hey, question title says it all. When I run webpack it seems to bundle all the modules in node_modules even though its ignored in the webpack config. This is my output after running webpack:

 webpack
Hash: e8457a8108e5f7ca1d9e
Version: webpack 2.2.1
Time: 2809ms
   Asset    Size  Chunks                    Chunk Names
bundle.js  711 kB       0  [emitted]  [big]  main
   [1] ./~/fbjs/lib/warning.js 2.1 kB {0} [built]
   [9] ./~/react-dom/lib/ReactUpdates.js 9.53 kB {0} [built]
  [14] ./~/react/lib/ReactElement.js 11.2 kB {0} [built]
  [17] ./~/react-dom/lib/ReactReconciler.js 6.21 kB {0} [built]
  [18] ./~/react/lib/React.js 2.69 kB {0} [built]
  [78] ./~/react-dom/index.js 59 bytes {0} [built]
  [79] ./~/react/react.js 56 bytes {0} [built]
 [107] ./~/react-dom/lib/ReactDOM.js 5.14 kB {0} [built]
 [168] ./~/react/lib/ReactClass.js 26.5 kB {0} [built]
 [169] ./~/react/lib/ReactDOMFactories.js 5.53 kB {0} [built]
 [170] ./~/react/lib/ReactPropTypes.js 15.8 kB {0} [built]
 [171] ./~/react/lib/ReactPureComponent.js 1.32 kB {0} [built]
 [172] ./~/react/lib/ReactVersion.js 350 bytes {0} [built]
 [174] ./~/react/lib/onlyChild.js 1.34 kB {0} [built]
 [176] ./src/app.js 281 bytes {0} [built]
    + 162 hidden modules

This is my webpack.config.js

module.exports = {
    entry: './app.js',

    output: {
        // path: 'build',
        filename: 'bundle.js'
    },

    module: {
        loaders: [
            {
                test: /\.js$/,
                exclude: /node_modules/,
                loader: 'babel-loader'
            }
        ]
    }
};

my .babelrc

{
    "presets": ["react", "es2015"
    ]
}

And my app.js is just importing things and console logging so I can see the output.

// Libs
import React from "react";
import ReactDOM from "react-dom";

console.log("This is working");

Any help would be appreciated!