Skip to content

Commit

Permalink
Fix uglify use with newer node versions (#78)
Browse files Browse the repository at this point in the history
Recent versions of node enforce the callback argument to writeFile or fail with errors like:
```
error(356) The optimizer threw an exception; the module probably contains syntax errors. module identifier: dojo/dojo; exception: TypeError [ERR_INVALID_CALLBACK]: Callback must be a function TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
```
Deal with this by explicitly providing a callback.
(cherry picked from commit 90f5ee8)
  • Loading branch information
jsonn authored and dylans committed Sep 5, 2019
1 parent ac08c6d commit b05b9f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion build/transforms/optimizer/uglify_worker.js
Expand Up @@ -36,7 +36,7 @@ function factory(uglify, fs){

if (useSourceMaps) {
output += "//# sourceMappingURL=" + dest.split("/").pop() + ".map";
fs.writeFile(dest + ".map", gen_options.source_map.toString(), "utf-8");
fs.writeFile(dest + ".map", gen_options.source_map.toString(), "utf-8", function() {});
}

return output;
Expand Down

0 comments on commit b05b9f6

Please sign in to comment.