File: fix-cspotcode-source-map-support-build.patch

package info (click to toggle)
ts-node 10.9.2%2B~cs64.13.20-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,388 kB
  • sloc: javascript: 15,071; sh: 83; makefile: 15; xml: 9
file content (69 lines) | stat: -rw-r--r-- 2,441 bytes parent folder | download | duplicates (2)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
Description: don't use network minifier
Author: Yadd <yadd@debian.org>
Forwarded: not-needed
Last-Update: 2022-06-09

--- a/cspotcode-source-map-support/build.js
+++ b/cspotcode-source-map-support/build.js
@@ -5,9 +5,7 @@
 var querystring = require('querystring');
 var child_process = require('child_process');
 
-var browserify = path.resolve(path.join('node_modules', '.bin', 'browserify'));
-var webpack = path.resolve(path.join('node_modules', '.bin', 'webpack'));
-var coffee = path.resolve(path.join('node_modules', '.bin', 'coffee'));
+var browserify = 'browserify';
 
 function run(command, callback) {
   console.log(command);
@@ -33,47 +31,9 @@
   ].join('\n');
 
   // Use the online Google Closure Compiler service for minification
-  fs.writeFileSync('.temp.js', querystring.stringify({
-    compilation_level: 'SIMPLE_OPTIMIZATIONS',
-    output_info: 'compiled_code',
-    output_format: 'text',
-    js_code: code
-  }));
-  run('curl -d @.temp.js "https://closure-compiler.appspot.com/compile"', function(error, stdout) {
+  fs.writeFileSync('.temp.js', code);
+  run('terser .temp.js', function(error, stdout) {
     if (error) throw error;
-    var code = header + '\n' + stdout;
-    fs.unlinkSync('.temp.js');
-    fs.writeFileSync('browser-source-map-support.js', code);
-    fs.writeFileSync('amd-test/browser-source-map-support.js', code);
+    fs.writeFileSync('browser-source-map-support.js', header+stdout);
   });
 });
-
-// Build the AMD test
-run(coffee + ' --map --compile amd-test/script.coffee', function(error) {
-  if (error) throw error;
-});
-
-// Build the browserify test
-run(coffee + ' --map --compile browserify-test/script.coffee', function(error) {
-  if (error) throw error;
-  run(browserify + ' --debug browserify-test/script.js > browserify-test/compiled.js', function(error) {
-    if (error) throw error;
-  })
-});
-
-// Build the browser test
-run(coffee + ' --map --compile browser-test/script.coffee', function(error) {
-  if (error) throw error;
-});
-
-// Build the header test
-run(coffee + ' --map --compile header-test/script.coffee', function(error) {
-  if (error) throw error;
-  var contents = fs.readFileSync('header-test/script.js', 'utf8');
-  fs.writeFileSync('header-test/script.js', contents.replace(/\/\/# sourceMappingURL=.*/g, ''))
-});
-
-// Build the webpack test
-child_process.exec(webpack, {cwd: 'webpack-test'}, function(error) {
-  if (error) throw error;
-});