This repository has been archived by the owner on Dec 26, 2022. It is now read-only.
forked from flef/Incipio
-
Notifications
You must be signed in to change notification settings - Fork 5
/
gulpfile.babel.js
47 lines (35 loc) · 2.07 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
'use strict';
var options = {
options: {
'env=prod': 'Assets build and processing are production ready'
}
};
var gulp = require('gulp-help')(require('gulp'), options);
var argv = require('yargs').argv;
var config = {
src: 'src/FrontBundle/Resources/assets',
dist: 'web/assets'
};
// Sets environment to production if "--env=prod" ou "--production" option
// is passed as a parameter. Otherwise default set to dev.
if ('prod' === argv.env || 'production' === argv.env) {
process.env.NODE_ENV = 'prod';
} else {
process.env.NODE_ENV = 'dev';
}
gulp.task('lint:yaml', 'Lint YAML files', require('./gulp-tasks/yaml-lint')(gulp, config));
gulp.task('css', 'Build the CSS assets', require('./gulp-tasks/sass')(gulp, config));
gulp.task('check:css', 'Check CSS duplications', require('./gulp-tasks/css-check')(gulp, config));
gulp.task('lint:css', 'Lint SASS files', require('./gulp-tasks/sass-lint')(gulp, config));
gulp.task('watch:css', 'Watch CSS files to build on change', require('./gulp-tasks/sass-watch')(gulp, config));
gulp.task('fonts', 'Publish the fonts assets', require('./gulp-tasks/fonts')(gulp, config));
gulp.task('watch:fonts', 'Watch fonts files to publish on change', require('./gulp-tasks/fonts-watch')(gulp, config));
gulp.task('img', 'Process the images', require('./gulp-tasks/images')(gulp, config));
gulp.task('watch:img', 'Watch images to process on change', require('./gulp-tasks/images-watch')(gulp, config));
gulp.task('js', 'Build the JavaScript assets', require('./gulp-tasks/scripts')(gulp, config));
gulp.task('lint:js', 'Lint JavaScript files', require('./gulp-tasks/scripts-lint')(gulp, config));
gulp.task('watch:js', 'Watch JavaScript files to build on change', require('./gulp-tasks/scripts-watch')(gulp, config));
gulp.task('build', 'Build and publish all assets', ['css', 'fonts', 'img', 'js']);
gulp.task('watch', 'Watch all assets for build on change', ['watch:css', 'watch:fonts', 'watch:img', 'watch:js']);
gulp.task('start', 'Build/publish all assets and watch files for any change', ['build', 'watch']);
gulp.task('default', ['help']);