Skip to content

Instantly share code, notes, and snippets.

@BiosBoy
Last active January 13, 2019 10:29
Show Gist options
  • Select an option

  • Save BiosBoy/ec38bcace6319637ec0184bb9adb80a2 to your computer and use it in GitHub Desktop.

Select an option

Save BiosBoy/ec38bcace6319637ec0184bb9adb80a2 to your computer and use it in GitHub Desktop.
// -----------------------------
// READING WEBPACK CONFIGURATION
// -----------------------------
function webpackCompiler() {
return new Promise((resolve, reject) => {
const compiler = webpack(webpackConfig);
compiler.run((err, stats) => {
if (err) {
debug('Webpack compiler encountered a fatal error.', err);
return reject(err);
}
const jsonStats = stats.toJson();
debug('Webpack compilation is completed.');
resolve(jsonStats);
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment