Skip to content

Commit

Permalink
👌 IMPROVE: Default Task
Browse files Browse the repository at this point in the history
  • Loading branch information
MaedahBatool committed Jul 5, 2018
1 parent ef78a77 commit f580b06
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 13 deletions.
39 changes: 27 additions & 12 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,48 @@
* @version 1.0.0
*/

var gulp = require('gulp');
var pug = require('gulp-pug');
var sass = require('gulp-sass');
// Configure.
const config = {
pugSrc: './views/**/*.pug',
pugDst: './',
scssSrc: './scss/style.scss',
scssDst: './',
pugWatchFiles: './views/**/*.pug',
scssWatchFiles: './scss/**/*.scss'
};

const gulp = require('gulp');
const pug = require('gulp-pug');
const sass = require('gulp-sass');

gulp.task('pug', function() {
return gulp
.src('./views/**/*.pug')
.src(config.pugSrc)
.pipe(
pug({
pretty: true
})
)
.pipe(gulp.dest('./'));
.pipe(gulp.dest(config.pugDst));
});

gulp.task('scss', function() {
return gulp
.src('./sass/style.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('./'));
.src('config.scssSrc')
.pipe(sass({ outputStyle: 'compressed' }).on('error', sass.logError))
.pipe(gulp.dest('config.scssDst'));
});

// gulp.task('hi', function() {
// console.log('Hi Meow');
// });
gulp.task('default', ['pug', 'scss'], function() {
gulp.watch(config.pugWatchFiles, ['pug']);
gulp.watch(config.scssWatchFiles, ['scss']);
});

// gulp.task('default', ['pug', 'scss'], function() {
// gulp.task('default', ['pug', 'scss'], function () {
// gulp.watch(pugFiles, 'pug');
// gulp.watch(scssFiles, 'scss');
// });

// gulp.task('hi', function() {
// console.log('Hi Meow');
// });
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@
"gulp": "^3.9.1",
"gulp-pug": "^4.0.1",
"gulp-sass": "^4.0.1"
},
"scripts": {
"start": "gulp"
}
}
1 change: 1 addition & 0 deletions scss/partial/body.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
vertical-align: middle;
font-size: 4rem;
color: white;
color: red !important;
}

.top h1 > span {
Expand Down
2 changes: 1 addition & 1 deletion scss/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* ------------------------------------------------------------------------- */

// — VENDORS.
@import 'vendor/normalize';
@import 'vendors/normalize';

// — PARTIALS.
@import 'partial/variables'; // Variables file
Expand Down
File renamed without changes.
5 changes: 5 additions & 0 deletions style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f580b06

Please sign in to comment.