File tree Expand file tree Collapse file tree 5 files changed +32
-9
lines changed Expand file tree Collapse file tree 5 files changed +32
-9
lines changed Original file line number Diff line number Diff line change
1
+ import { phpMinify } from "@cedx/php-minifier" ;
2
+ import gulp from "gulp" ;
3
+ import process from "node:process" ;
4
+
5
+ // Compresses a given set of PHP scripts.
6
+ export function compressPhp ( ) {
7
+ const isWindows = process . platform == "win32" ;
8
+ const options = {
9
+ binary : isWindows ? "C:/Program Files/PHP/php.exe" : "/usr/bin/php" ,
10
+ mode : isWindows ? "safe" : "fast" ,
11
+ silent : process . stdout . isTTY
12
+ } ;
13
+
14
+ return gulp . src ( "path/to/**/*.php" , { read : false } )
15
+ . pipe ( phpMinify ( options ) )
16
+ . pipe ( gulp . dest ( "path/to/out" ) ) ;
17
+ }
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 5
5
"license" : " MIT" ,
6
6
"name" : " @cedx/php-minifier" ,
7
7
"repository" : " cedx/php-minifier" ,
8
- "type" : " commonjs " ,
9
- "version" : " 4 .0.1 " ,
8
+ "type" : " module " ,
9
+ "version" : " 5 .0.0 " ,
10
10
"author" : {
11
11
"email" : " cedric@belin.io" ,
12
12
"name" : " Cédric Belin" ,
20
20
"plugin-error" : " ^2.0.1"
21
21
},
22
22
"devDependencies" : {
23
+ "@coffeelint/cli" : " ^5.2.11" ,
24
+ "@types/gulp" : " ^4.0.17" ,
23
25
"@types/node" : " ^22.8.7" ,
26
+ "coffeescript" : " ^2.7.0" ,
24
27
"terser" : " ^5.36.0" ,
25
28
"vinyl" : " ^3.0.0"
26
29
},
29
32
},
30
33
"exports" : {
31
34
"types" : " ./lib/index.d.ts" ,
32
- "import" : " ./lib/index.mjs" ,
33
- "default" : " ./lib/index.cjs"
35
+ "default" : " ./lib/index.js"
34
36
},
35
37
"files" : [
36
38
" lib/" ,
39
+ " src/" ,
37
40
" www/"
38
41
],
39
42
"keywords" : [
48
51
},
49
52
"scripts" : {
50
53
"start" : " node bin/php_minifier.js --help" ,
51
- "test" : " lix Test "
54
+ "test" : " cake test "
52
55
}
53
56
}
Original file line number Diff line number Diff line change
1
+ {
2
+ "compilerOptions" : {
3
+ "allowJs" : true ,
4
+ "noEmit" : true ,
5
+ "module" : " NodeNext"
6
+ }
7
+ }
You can’t perform that action at this time.
0 commit comments