title: Webpack ignores webpack.config.js
body: <p>I'm following <a href="https://www.valentinog.com/blog/webpack-4-tutorial/" rel="noreferrer">this tutorial</a> because I'm new with Webpack... My webpack.config.js is:</p>
  
  <pre><code>module.exports = {
      entry: "./app/entry",
      mode: "development",
      module: {
          rules: [
              {
                  test: /\.js$/,
                  exclude: /node_modules/,
                  use: {
                      loader: "babel-loader"
                  }
              }
          ]
      }
  };
  </code></pre>
  
  <p>And my <code>package.json</code>:</p>
  
  <pre><code>{
    "name": "pruebaWebpack",
    "version": "1.0.0",
    "description": "",
    "main": "index.js",
    "scripts": {
      "test": "echo \"Error: no test specified\" &amp;&amp; exit 1",
      "build": "webpack",
    },
    "keywords": [],
    "author": "",
    "license": "ISC",
    "devDependencies": {
      "babel-core": "^6.26.0",
      "babel-loader": "^7.1.4",
      "babel-preset-env": "^1.6.1",
      "babel-preset-react": "^6.24.1",
      "webpack": "^4.4.1",
      "webpack-cli": "^2.0.13",
      "webpack-dev-server": "^3.1.1"
    },
    "dependencies": {
      "react": "^16.3.0",
      "react-dom": "^16.3.0"
    }
  }
  </code></pre>
  
  <p>But apparently It's ignoring my config file because when I run <code>npm run build</code> It uses default paths (entry = ./src y output = ./dist) and doesn't recognize the mode attribute:</p>
  
  <blockquote>
    <p>pruebaWebpack@1.0.0 build /opt/lampp/htdocs/pruebaWebpack</p>
    
    <p>webpack</p>
    
    <p>Hash: 4a9c3de0f194dd38ac70 Version: webpack 4.4.1 </p>
    
    <p>Time: 234ms </p>
    
    <p>Built at: 2018-4-1 15:53:00   Asset       Size  Chunks<br>
    Chunk</p>
    
    <p>Names main.js  564 bytes       0  [emitted]  main Entrypoint main =
    main.js    [0] ./src/index.js 19 bytes {0} [built]</p>
    
    <p>WARNING in configuration The 'mode' option has not been set, webpack
    will fallback to 'production' for this value. Set 'mode' option to
    'development' or 'production' to enable defaults for each environment.
    You can also set it to 'none' to disable any default behavior. Learn
    more: <a href="https://webpack.js.org/concepts/mode/" rel="noreferrer">https://webpack.js.org/concepts/mode/</a></p>
  </blockquote>
  
  <p>Thanks in advance and sorry about my English.</p>