-
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
Mar 27, 2024
1 parent
ef28f8f
commit cf19c09
Showing
5 changed files
with
15,011 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 less from 'gulp-less'; | ||
import postcss from 'gulp-postcss'; | ||
import autoprefixer from 'autoprefixer'; | ||
import browser from 'browser-sync'; | ||
|
||
// Styles | ||
|
||
export const styles = () => { | ||
return gulp.src('source/less/style.less', { sourcemaps: true }) | ||
.pipe(plumber()) | ||
.pipe(less()) | ||
.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/less/**/*.less', gulp.series(styles)); | ||
gulp.watch('source/*.html').on('change', browser.reload); | ||
} | ||
|
||
|
||
export default gulp.series( | ||
styles, server, watcher | ||
); |
Oops, something went wrong.