-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
31 lines (25 loc) · 953 Bytes
/
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
const gulp = require('gulp');
const chalk = require('chalk');
const sass = require('gulp-sass');
const rename = require('gulp-rename');
const styleBuilder = (folder, outName) =>
gulp.src(`./app/sass/${folder}/App.scss`)
.pipe(sass().on('error', sass.logError))
.pipe(rename(outName))
.pipe(gulp.dest('./public/stylesheets'));
gulp.task('styles-desktop', () => styleBuilder('desktop', 'main.css'));
gulp.task('styles-mobile', () => styleBuilder('mobile', 'mobile.css'));
gulp.task('styles', () => {
gulp.start('styles-desktop');
gulp.start('styles-mobile');
});
gulp.task('styles:watch', ['styles'], () => {
gulp.watch('app/sass/**', ['styles']);
});
gulp.task('default', () => {
console.log(chalk.yellow('For build use:'));
console.log(chalk.yellow('gulp styles'));
console.log(chalk.yellow('gulp watch-styles'));
console.log(chalk.yellow('gulp styles-desktop'));
console.log(chalk.yellow('gulp styles-mobile'));
});