Skip to content

Commit 7090e58

Browse files
authoredMar 10, 2020
Cleanup build-javascript (#22033)
* Cleanup build-javascript * Update build-javascript.ts * Cleanup even more
1 parent 3ef38db commit 7090e58

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed
 

‎packages/gatsby/src/commands/build-javascript.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
import { Span } from "opentracing"
12
import webpack from "webpack"
3+
24
import webpackConfig from "../utils/webpack.config"
5+
36
import { IProgram } from "./types"
4-
import { Span } from "opentracing"
57

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

@@ -22,18 +24,16 @@ export const buildProductionBundle = async (
2224
return new Promise((resolve, reject) => {
2325
webpack(compilerConfig).run((err, stats) => {
2426
if (err) {
25-
reject(err)
26-
return
27+
return reject(err)
2728
}
2829

2930
reportWebpackWarnings(stats)
3031

3132
if (stats.hasErrors()) {
32-
reject(stats.compilation.errors)
33-
return
33+
return reject(stats.compilation.errors)
3434
}
3535

36-
resolve(stats)
36+
return resolve(stats)
3737
})
3838
})
3939
}

0 commit comments

Comments
 (0)
Please sign in to comment.