-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Grégori Sória
committed
Feb 5, 2020
1 parent
80f5ede
commit a26d2e2
Showing
9 changed files
with
6,068 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
tests/style.css |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
const gulp = require('gulp'); | ||
const sass = require('gulp-sass'); | ||
const cleanCss = require('gulp-clean-css'); | ||
const notifier = require('node-notifier'); | ||
const browserSync = require('browser-sync').create(); | ||
sass.compiler = require('node-sass'); | ||
|
||
const src_folder = 'tests/'; | ||
|
||
gulp.task('serve', () => { | ||
return browserSync.init({ | ||
server: { | ||
baseDir: [ 'tests' ] | ||
}, | ||
port: 3000, | ||
open: false | ||
}); | ||
}); | ||
|
||
gulp.task('watch', () => { | ||
gulp.watch([`tests/**/*.html`], gulp.series('html')).on('change', () => { | ||
notifier.notify({ | ||
title: 'HTML changed', | ||
message: 'HTML changed successfully!', | ||
}); | ||
browserSync.reload; | ||
}); | ||
gulp.watch([`tests/**/*.scss`], gulp.series('scss')).on('change', () => { | ||
notifier.notify({ | ||
title: 'SCSS changed', | ||
message: 'SCSS changed successfully!', | ||
}); | ||
browserSync.reload; | ||
}); | ||
}); | ||
|
||
gulp.task('html', () => { | ||
return gulp.src([ `${src_folder}**/*.html` ], { | ||
base: src_folder, | ||
since: gulp.lastRun('html') | ||
}) | ||
.pipe(browserSync.stream()); | ||
}); | ||
|
||
gulp.task('scss', () => { | ||
return gulp | ||
.src([`${src_folder}**/*.scss`]) | ||
.pipe(sass().on('error', sass.logError)) | ||
.pipe(cleanCss({ | ||
level: { | ||
2: { | ||
all: true, | ||
} | ||
} | ||
})) | ||
.pipe(gulp.dest(src_folder)) | ||
.pipe(browserSync.stream()); | ||
}); | ||
|
||
gulp.task('tests', gulp.series('scss', gulp.parallel('serve', 'watch'))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.