This repository has been archived by the owner on Apr 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
119 lines (106 loc) · 2.74 KB
/
gulpfile.js
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
import gulp from 'gulp';
import replace from 'gulp-replace';
import shell from 'gulp-shell';
import merge from 'merge-stream';
gulp.task(
'build:deps:composer:scoper',
shell.task('vendor/bin/php-scoper add-prefix --force')
);
gulp.task( 'build:deps:composer:certs', function () {
return gulp
.src( ['vendor/**/*.pem'] )
.pipe( gulp.dest( 'dist/vendor/' ) );
} );
gulp.task(
'build:deps:composer:autoloader',
gulp.series(
shell.task(
'composer dump-autoload --no-dev' +
( process.env.NODE_ENV === 'production' ? ' -o' : '' )
),
function () {
return merge(
gulp.src( [
'vendor/composer/autoload_classmap.php',
//'vendor/composer/autoload_files.php',
'vendor/composer/autoload_namespaces.php',
'vendor/composer/autoload_psr4.php',
] ),
gulp
.src( [ 'vendor/composer/autoload_static.php' ] )
.pipe(
replace(
'namespace Composer\\Autoload;',
'namespace FioTransactions\\Vendor\\Composer\\Autoload;'
)
)
.pipe(
replace(
/'(.*)\\\\' => \n/g,
"'FioTransactions\\\\Vendor\\\\$1\\\\' => \n"
)
)
).pipe( gulp.dest( 'dist/vendor/composer/' ) );
},
shell.task( 'composer dump-autoload' )
)
);
gulp.task(
'build:deps:composer',
gulp.series(
'build:deps:composer:scoper',
'build:deps:composer:certs',
'build:deps:composer:autoloader'
)
);
gulp.task( 'build:deps:npm:datatables.net:files', function () {
return gulp
.src( ['node_modules/datatables.net-plugins/i18n/cs.json'] )
.pipe( gulp.dest( 'dist/bundled/datatables-files' ) );
} );
gulp.task( 'build:deps:npm:datatables.net', gulp.parallel( 'build:deps:npm:datatables.net:files', function () {
return gulp
.src( ['node_modules/datatables.net-dt/css/jquery.dataTables.min.css', 'node_modules/datatables.net/js/jquery.dataTables.min.js', 'node_modules/datatables.net-plugins/sorting/datetime-moment.js'] )
.pipe( gulp.dest( 'dist/bundled/' ) );
} ) );
gulp.task( 'build:deps:npm:moment', function () {
return gulp
.src( 'node_modules/moment/min/moment.min.js' )
.pipe( gulp.dest( 'dist/bundled/' ) );
} );
gulp.task(
'build:deps:npm',
gulp.series(
'build:deps:npm:datatables.net',
'build:deps:npm:moment',
)
);
gulp.task(
'build:deps',
gulp.parallel( 'build:deps:composer', 'build:deps:npm' )
);
gulp.task( 'build:php:base', function () {
return gulp
.src( [ 'src/*.php' ] )
.pipe( gulp.dest( 'dist/' ) );
} );
gulp.task( 'build:php:other', function () {
// TODO: Split these
return gulp
.src( [ 'src/**/*.css', 'src/**/*.js', 'src/**/*.php', 'src/**/*.png', 'src/**/*.txt' ] )
.pipe( gulp.dest( 'dist/' ) );
} );
gulp.task(
'build:php',
gulp.parallel(
'build:php:base',
'build:php:other'
)
);
gulp.task(
'build',
gulp.parallel(
'build:deps',
'build:php'
)
);