title: How to use FS module inside Electron.Atom\WebPack application?
body: <p>I need write some data in the file, using FS module (fs.writeFile). My stack is webpack + react + redux + electron.</p>
  
  <p>The first problem was: <strong>Cannot resolve module 'fs'</strong>.
  I tried to use </p>
  
  <pre><code>target: "node",
  ---
  node: {
      global: true,
      fs: "empty",
  }
  ---
  resolve: {
      root: path.join(__dirname),
      fallback: path.join(__dirname, 'node_modules'),
      modulesDirectories: ['node_modules'],
      extensions: ['', '.json', '.js', '.jsx', '.scss', '.png', '.jpg', '.jpeg', '.gif']
  },
  </code></pre>
  
  <p>After several attempts, the problem is resolved ( <strong>node: {fs: "empty"}</strong> ). But then there was a second problem: <a href="http://joxi.ru/Q2KVq7Xu98kyLm.jpg" rel="noreferrer">screenshot</a>.</p>
  
  <pre><code>//In method componentDidMount (React)
  console.log('fs', fs);
  console.log('typeOf', typeof fs.writeFile);
  
  //By clicking on the button
  console.log(fs);
  console.log(typeof fs.writeFile);
  </code></pre>
  
  <p>You can see, that <strong>fs</strong> is empty object, and method writeFile no exists. I tried to change the webpack's configuration.</p>
  
  <pre><code>const path = require('path');
  const fs = require('fs');
  const webpack = require("webpack");
  console.log(fs);
  </code></pre>
  
  <p>In this case <strong>fs</strong> is not empty.</p>
  
  <p>How to solve this problem? Any ideas?</p>