@@ -14,7 +14,7 @@ const Sprout = require('sprout')
14
14
const Joi = require ( 'joi' )
15
15
const { EventEmitter} = require ( 'events' )
16
16
const Config = require ( './config' )
17
- const Errors = require ( './errors' )
17
+ const { Error , Warning } = require ( './errors' )
18
18
19
19
/**
20
20
* @class Spike
@@ -157,17 +157,17 @@ function npmInstall (opts) {
157
157
*/
158
158
function compileCallback ( id , err , stats ) {
159
159
if ( err ) {
160
- return this . emit ( 'error' , new Errors . Error ( { id : id , message : err } ) )
160
+ return this . emit ( 'error' , new Error ( { id : id , message : err } ) )
161
161
}
162
162
// Webpack "soft errors" are classified as warnings in spike. An error is
163
163
// an error. If it doesn't break the build, it's a warning.
164
164
const jsonStats = stats . toJson ( )
165
165
if ( jsonStats . errors . length ) {
166
- this . emit ( 'warning' , new Errors . Warning ( { id : id , message : jsonStats . errors } ) )
166
+ this . emit ( 'warning' , new Warning ( { id : id , message : jsonStats . errors } ) )
167
167
}
168
168
/* istanbul ignore next */
169
169
if ( jsonStats . warnings . length ) {
170
- this . emit ( 'warning' , new Errors . Warning ( { id : id , message : jsonStats . warnings } ) )
170
+ this . emit ( 'warning' , new Warning ( { id : id , message : jsonStats . warnings } ) )
171
171
}
172
172
173
173
this . emit ( 'compile' , { id : id , stats : stats } )
0 commit comments