File tree Expand file tree Collapse file tree 1 file changed +23
-10
lines changed Expand file tree Collapse file tree 1 file changed +23
-10
lines changed Original file line number Diff line number Diff line change @@ -232,16 +232,29 @@ module.exports = function (bannerWidth, libraryPaths) {
232
232
done ( ) ;
233
233
}
234
234
235
- // perform the sass render
236
- sass . render ( {
237
- file : file . path ,
238
- data : file . contents . toString ( ) ,
239
- success : successHandler ,
240
- error : errorHandler ,
241
- includePaths : libList ,
242
- outputStyle : 'compressed' ,
243
- stats : { } ,
244
- sourceMap : mapName
235
+ /**
236
+ * Perform the sass render with the given <code>sourceMap</code>, <code>error</code>, and <code>success</code>
237
+ * parameters.
238
+ * @param {string|boolean } map The source map filename or <code>false</code> for none
239
+ * @param {function ({string}) } error Handler for error
240
+ * @param {function ({string}, {string}) } success Handler for success
241
+ */
242
+ function render ( map , error , success ) {
243
+ sass . render ( {
244
+ file : file . path ,
245
+ data : file . contents . toString ( ) ,
246
+ success : success ,
247
+ error : error ,
248
+ includePaths : libList ,
249
+ outputStyle : 'compressed' ,
250
+ stats : { } ,
251
+ sourceMap : map
252
+ } ) ;
253
+ }
254
+
255
+ // run first without source-map as this can cause process exit where errors exist
256
+ render ( false , errorHandler , function ( ) {
257
+ render ( mapName , errorHandler , successHandler ) ;
245
258
} ) ;
246
259
247
260
} , function ( done ) {
You can’t perform that action at this time.
0 commit comments