Skip to content
This repository was archived by the owner on Mar 23, 2024. It is now read-only.

Commit f233010

Browse files
committed
Merge pull request #110 from negative/fix-missing-asset
Raise requirejs compilation errors and exit from node with code 1
2 parents e1060b5 + a58c6d7 commit f233010

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/requirejs/rails/rjs_driver.js.erb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ var module_specs = [
2020
<% end %>
2121
];
2222

23+
// Error handler invoked in case requirejs compilation fails
24+
var errback = function(error) {
25+
process.stderr.write(error.toString());
26+
process.exit(1);
27+
}
28+
2329
// Do a series of builds of individual files, using the args suggested by:
2430
// http://requirejs.org/docs/optimization.html#onejs
2531
//
@@ -28,6 +34,7 @@ var module_specs = [
2834
var async_runner = module_specs.reduceRight(function(prev, curr) {
2935
return function (buildReportText) {
3036
requirejs.optimize(mix(curr), prev);
37+
requirejs.optimize(mix(curr), prev, errback);
3138
};
3239
}, function(buildReportText) {} );
3340

0 commit comments

Comments
 (0)