how can I use fs in react with electron?
<p>I want use react+webpack+electron to build a desktop app.How can I inject <code>fs</code> module into react so that I can use it to read native files?
I have a component such as:</p>

<pre><code>class Some extends Component {
  render() {
    return &lt;div&gt;{this.props.content}&lt;/div&gt;
  }
}
export default Some;
</code></pre>

<p>in <code>entry.js</code>:</p>

<pre><code>import React from 'react';
import { render } from 'react-dom';
import Some from './src/some.jsx';

const data = "some content";
/*
 How can I read data by fs module?
 import fs from 'fs' doesn't work here
*/
render(
  &lt;Some content={data} /&gt;,
  document.getElementById('app')
);
</code></pre>

<p>I use webpack to build js codes into a bundle.js,and in index.html</p>

<pre><code>...
&lt;div id="app"&gt;&lt;/div&gt;
&lt;script src="bundle.js"&gt;&lt;/script&gt;
...
</code></pre>

<p>In <code>webpack.config.js</code>:</p>

<pre><code>...
plugins: [new webpack.IgnorePlugin(new RegExp("^(fs|ipc)$"))]
...
</code></pre>

<p>I find this config on the internet because if I don't add it the webpack will report error,but I don't know how this means. </p>

<p>And I have a very easy <code>main.js</code> which is the same as electron-quick-start's main.js</p>

<p>Do I lose some important things?</p>

<p>It can't be better if u can provide a existed example on github repo.</p>