-
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
Keks
committed
Dec 17, 2024
1 parent
2eff39e
commit eba9190
Showing
5 changed files
with
14,789 additions
and
3,288 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,45 @@ | ||
import gulp from 'gulp'; | ||
import plumber from 'gulp-plumber'; | ||
import sass from 'gulp-dart-sass'; | ||
import postcss from 'gulp-postcss'; | ||
import autoprefixer from 'autoprefixer'; | ||
import browser from 'browser-sync'; | ||
|
||
// Styles | ||
|
||
export const styles = () => { | ||
return gulp.src('source/sass/style.scss', { sourcemaps: true }) | ||
.pipe(plumber()) | ||
.pipe(sass().on('error', sass.logError)) | ||
.pipe(postcss([ | ||
autoprefixer() | ||
])) | ||
.pipe(gulp.dest('source/css', { sourcemaps: '.' })) | ||
.pipe(browser.stream()); | ||
} | ||
|
||
// Server | ||
|
||
const server = (done) => { | ||
browser.init({ | ||
server: { | ||
baseDir: 'source' | ||
}, | ||
cors: true, | ||
notify: false, | ||
ui: false, | ||
}); | ||
done(); | ||
} | ||
|
||
// Watcher | ||
|
||
const watcher = () => { | ||
gulp.watch('source/sass/**/*.scss', gulp.series(styles)); | ||
gulp.watch('source/*.html').on('change', browser.reload); | ||
} | ||
|
||
|
||
export default gulp.series( | ||
styles, server, watcher | ||
); |
Oops, something went wrong.