title: load local jSON file in Reactjs without installing a localserver
body: <p>I have a structure of src/resource/file.json.<a href="https://i.stack.imgur.com/qjITH.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qjITH.jpg" alt="enter image description here"></a></p>
  
  <p>1.By installing load-json and using require:</p>
  
  <pre><code>    class App extends Component{  
  
        constructor(props) {
              super(props);
              this.state = {summaryData: [], sortBy: null};
              this.sortContent = this.sortContent.bind(this);
              }
           componentWillMount() {
  
              require('../resource/file.json')
                    .then(response =&gt; {
                      // Convert to JSON
                      return response;
                    })
                    .then(findresponse =&gt; {
                      // findresponse is an object
                      console.log(findresponse);
                      this.setState({summaryData: findresponse});
                    })
                    .catch(norespone =&gt; {
                      console.log('Im sorry but i could not fetch anything');
                    });
                }
  </code></pre>
  
  <p>And appears the message :
  Module not found: Can't resolve '../resource/file.json' in 'C:\Xampp\htdocs\path\to\app\src\pages'</p>
  
  <ol start="2">
  <li><p>Through myJSON:</p>
  
  <pre><code>request('https://api.myjson.com/bins/{id..}').then(sumres =&gt; {
    if (sumres) {
      this.setState({summaryData: sumres});
      console.log(this.state.summaryData);
    }
  });
  </code></pre>
  
  <p>}</p></li>
  </ol>
  
  <p>But nothing appears in the console or the network tab. Cans someone propose a solution?
  Is it possible to load the json file without installing a local server?</p>