title: How can i return a promise or wait for require?
body: <p>This is for my vuejs+webpack project  </p>
  
  <p>How can i return a promise or wait for require to load a file ?</p>
  
  <p><strong>exmaple :</strong></p>
  
  <pre><code>var myfile= require('./assets/myjson.json') // a big json file
  console.log(myfile) //this sometime not printed correctly
  </code></pre>
  
  <p>sometime console.log not print object correctly in console</p>
  
  <p>so i would like to know whether it is possible to return promise like this</p>
  
  <pre><code>require('./assets/myjson.json').then(function(){ 
     // big file loaded completetly
     console.log(myfile) 
  }
  </code></pre>
  
  <p>i have to process the object after the require callback, i dont find a way to do this</p>
  
  <p>the object is printed in console as below
  <a href="https://i.stack.imgur.com/R3vd1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/R3vd1.png" alt="enter image description here"></a></p>