Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ http_archive(
# Add sass rules
http_archive(
name = "io_bazel_rules_sass",
# Patch `rules_sass` to work around a bug that causes error messages to be not
# printed in worker mode: https://github.com/bazelbuild/rules_sass/issues/96.
# TODO(devversion): remove this patch once the Sass Node entry-point returns a `Promise`.
patches = ["//tools/bazel:sass_worker_async.patch"],
sha256 = "c78be58f5e0a29a04686b628cf54faaee0094322ae0ac99da5a8a8afca59a647",
strip_prefix = "rules_sass-1.25.0",
urls = [
Expand Down
15 changes: 15 additions & 0 deletions tools/bazel/sass_worker_async.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git sass/sass_wrapper.js sass/sass_wrapper.js
index 21abb8f..168ee49 100644
--- sass/sass_wrapper.js
+++ sass/sass_wrapper.js
@@ -17,7 +17,9 @@ const fs = require('fs');
const args = process.argv.slice(2);
if (runAsWorker(args)) {
debug('Starting Sass compiler persistent worker...');
- runWorkerLoop(args => sass.run_(args));
+ runWorkerLoop(args => {
+ return new Promise((resolve, reject) => sass.run_(args)['then$1$2$onError'](resolve, reject));
+ });
// Note: intentionally don't process.exit() here, because runWorkerLoop
// is waiting for async callbacks from node.
} else {