forked from Sylius/Sylius-Standard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.babel.js
63 lines (53 loc) · 2.04 KB
/
gulpfile.babel.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
import chug from 'gulp-chug';
import gulp from 'gulp';
import yargs from 'yargs';
const { argv } = yargs
.options({
rootPath: {
description: '<path> path to web assets directory',
type: 'string',
requiresArg: true,
required: false,
},
nodeModulesPath: {
description: '<path> path to node_modules directory',
type: 'string',
requiresArg: true,
required: false,
},
});
const config = [
'--rootPath',
argv.rootPath || '../../../../../../../public/assets',
'--nodeModulesPath',
argv.nodeModulesPath || '../../../../../../../node_modules',
];
export const buildAdmin = function buildAdmin() {
return gulp.src('vendor/sylius/sylius/src/Sylius/Bundle/AdminBundle/gulpfile.babel.js', { read: false })
.pipe(chug({ args: config, tasks: 'build' }));
};
buildAdmin.description = 'Build admin assets.';
export const watchAdmin = function watchAdmin() {
return gulp.src('vendor/sylius/sylius/src/Sylius/Bundle/AdminBundle/gulpfile.babel.js', { read: false })
.pipe(chug({ args: config, tasks: 'watch' }));
};
watchAdmin.description = 'Watch admin asset sources and rebuild on changes.';
export const buildShop = function buildShop() {
return gulp.src('vendor/sylius/sylius/src/Sylius/Bundle/ShopBundle/gulpfile.babel.js', { read: false })
.pipe(chug({ args: config, tasks: 'build' }));
};
buildShop.description = 'Build shop assets.';
export const watchShop = function watchShop() {
return gulp.src('vendor/sylius/sylius/src/Sylius/Bundle/ShopBundle/gulpfile.babel.js', { read: false })
.pipe(chug({ args: config, tasks: 'watch' }));
};
watchShop.description = 'Watch shop asset sources and rebuild on changes.';
export const build = gulp.parallel(buildAdmin, buildShop);
build.description = 'Build assets.';
export const watch = gulp.parallel(watchAdmin, watchShop);
watch.description = 'Watch asset sources and rebuild on changes.';
gulp.task('admin', buildAdmin);
gulp.task('admin-watch', watchAdmin);
gulp.task('shop', buildShop);
gulp.task('shop-watch', watchShop);
export default build;