-
Notifications
You must be signed in to change notification settings - Fork 309
/
Copy pathgulp@5.0.0.patch
46 lines (46 loc) · 1.16 KB
/
gulp@5.0.0.patch
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
diff --git a/bin/gulp.js b/bin/gulp.js
index f4b80cc41c688105989296a0731729a171b27ac0..168717d5afce46eeefa118dd9aa6ef9a8f455ded 100755
--- a/bin/gulp.js
+++ b/bin/gulp.js
@@ -1,3 +1,3 @@
#!/usr/bin/env node
-
-require('gulp-cli')();
+const cli = require('gulp-cli');
+cli();
diff --git a/bin/swc-gulp.js b/bin/swc-gulp.js
new file mode 100644
index 0000000000000000000000000000000000000000..a14351c2a7743af318d7efab246099c142bf3813
--- /dev/null
+++ b/bin/swc-gulp.js
@@ -0,0 +1,17 @@
+#!/usr/bin/env node
+
+const { spawnSync } = require('child_process');
+const { join } = require('path');
+const child = spawnSync(
+ process.execPath,
+ [
+ '--import',
+ '@swc-node/register/esm-register',
+ join(__dirname, './gulp.js'),
+ ...process.argv.slice(2),
+ ],
+ {
+ stdio: 'inherit',
+ }
+);
+if (child.status) process.exit(child.status);
diff --git a/package.json b/package.json
index be5477ddf77fc32ebce569347c38ac322dbda6e7..c27a348e4c84f08865c91ece656b41145440064b 100644
--- a/package.json
+++ b/package.json
@@ -27,7 +27,7 @@
"bin"
],
"bin": {
- "gulp": "./bin/gulp.js"
+ "gulp": "./bin/swc-gulp.js"
},
"scripts": {
"lint": "eslint .",