Skip to content

Commit

Permalink
Cleanup build-javascript (#22033)
Browse files Browse the repository at this point in the history
* Cleanup build-javascript

* Update build-javascript.ts

* Cleanup even more
  • Loading branch information
MichaelDeBoey authored Mar 10, 2020
1 parent 3ef38db commit 7090e58
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/gatsby/src/commands/build-javascript.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { Span } from "opentracing"
import webpack from "webpack"

import webpackConfig from "../utils/webpack.config"

import { IProgram } from "./types"
import { Span } from "opentracing"

import { reportWebpackWarnings } from "../utils/webpack-error-utils"

Expand All @@ -22,18 +24,16 @@ export const buildProductionBundle = async (
return new Promise((resolve, reject) => {
webpack(compilerConfig).run((err, stats) => {
if (err) {
reject(err)
return
return reject(err)
}

reportWebpackWarnings(stats)

if (stats.hasErrors()) {
reject(stats.compilation.errors)
return
return reject(stats.compilation.errors)
}

resolve(stats)
return resolve(stats)
})
})
}

0 comments on commit 7090e58

Please sign in to comment.