We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent afd09d1 commit 9477ff8Copy full SHA for 9477ff8
packages/gatsby/src/commands/build-javascript.js
@@ -11,7 +11,20 @@ module.exports = async program => {
11
`build-javascript`
12
)
13
14
- return new Promise(resolve => {
15
- webpack(compilerConfig.resolve()).run(() => resolve())
+ return new Promise((resolve, reject) => {
+ webpack(compilerConfig.resolve()).run((err, stats) => {
16
+ if (err) {
17
+ reject(err)
18
+ return
19
+ }
20
+
21
+ const jsonStats = stats.toJson()
22
+ if (jsonStats.errors && jsonStats.errors.length > 0) {
23
+ reject(jsonStats.errors[0])
24
25
26
27
+ resolve()
28
+ })
29
})
30
}
0 commit comments