File: gruntfile.patch

package info (click to toggle)
node-knockout 3.4.2-2%2Bdeb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,924 kB
  • sloc: makefile: 7; sh: 2
file content (35 lines) | stat: -rw-r--r-- 1,278 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -103,13 +103,16 @@
     }
 
     function buildMin(output, done) {
-        var cc = require('closure-compiler');
-        var options = {
-            compilation_level: 'ADVANCED_OPTIMIZATIONS',
-            output_wrapper: '(function() {%output%})();'
-        };
-        grunt.log.write('Compiling...');
-        cc.compile('/**@const*/var DEBUG=false;' + getCombinedSources(), options, function (err, stdout, stderr) {
+        var execFile = require('child_process').execFile;
+        var stream = require('stream');
+        var options = [
+            '--compilation_level', 'ADVANCED_OPTIMIZATIONS',
+            '--output_wrapper', '(function() {%output%})();'
+        ];
+        var source = new stream.Readable();
+        source.push('/**@const*/var DEBUG=false;' + getCombinedSources());
+        source.push(null);
+        var cc = execFile('closure-compiler', options, function (err, stdout, stderr) {
             if (err) {
                 grunt.log.error(err);
                 done(false);
@@ -119,6 +122,8 @@
                 done(true);
             }
         });
+        grunt.log.write('Compiling...');
+        source.pipe(cc.stdin);
     }
 
     grunt.registerMultiTask('build', 'Build', function() {