Webpack nodejs fs.readFile is not a function
<p>I have a webpack config like:</p>

<pre><code>var path = require('path')

module.exports = {
    entry: "./index.js",
    output: {
        path: path.join(__dirname, 'static'),
        filename:'bundle.js'
    },
    module: {
        loaders: [
            { test: /\.js$/, exclude: /node_modules/, loader: "babel-loader"},
            { test: /\.json$/, loader: 'json-loader' },
        ]
    },
    node: {
      fs: "empty"
    }
};
</code></pre>

<p>And I want to read a file using <code>fs</code></p>

<p>I am doing something like:</p>

<pre><code>var fs = require('fs')
console.log(fs)

fs.readFile('input.txt', function (err, buffer) {
        console.log("buffer")
        console.log(buffer)


    })
</code></pre>

<p>I just want to read a file here but when I do this it gives me error saying: </p>

<blockquote>
  <p><code>fs.readFile</code> is not a function</p>
</blockquote>

<p>I have installed <code>fs</code> using <code>npm install --save fs</code></p>

<p>Also when I print <code>fs</code> it gives me empty object.
Above I have done <code>console.log(fs)</code> it is giving me empty object</p>

<p>What is wrong in here?</p>