Answer the question
In order to leave comments, you need to log in
Why does gulp-webpack build stop working when using async/await?
Made a Gulp+Webpack build.
Started writing a module using async/await
const asyncAwait = () => {
const url = 'https://api.github.com/repos/javascript-tutorial/en.javascript.info/commits';
const url2 = 'https://api.github.com/users';
async function getUser() {
let commits = await fetch(url);
console.log(commits);
}
getUser();
}
module.exports = asyncAwait;
module.exports = {
mode: process.env.NODE_ENV,
//development production
mode: 'development',
output: {
filename: 'script.js',
},
module: {
rules: [
{
test: /\.m?js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env']
}
}
}
]
},
};
Answer the question
In order to leave comments, you need to log in
Here is the solution: https://stackoverflow.com/a/36821986/6912339
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question