Skip to content

Commit a690814

Browse files
author
benholloway
committed
reinstated 2-pass sass generation; errors where source maps exist can cause process to exit
1 parent 070fcdc commit a690814

File tree

1 file changed

+23
-10
lines changed

1 file changed

+23
-10
lines changed

lib/build/node-sass.js

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -232,16 +232,29 @@ module.exports = function (bannerWidth, libraryPaths) {
232232
done();
233233
}
234234

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);
245258
});
246259

247260
}, function (done) {

0 commit comments

Comments
 (0)