This is for my vuejs+webpack project
How can i return a promise or wait for require to load a file ?
exmaple :
var myfile= require('./assets/myjson.json') // a big json file
console.log(myfile) //this sometime not printed correctly
sometime console.log not print object correctly in console
so i would like to know whether it is possible to return promise like this
require('./assets/myjson.json').then(function(){
// big file loaded completetly
console.log(myfile)
}
i have to process the object after the require callback, i dont find a way to do this