Skip to content

Commit

Permalink
Merge pull request #37 from UTCGilligan/feature/UTCT-36-frontend-tool…
Browse files Browse the repository at this point in the history
…ing-assets

UTCT-36: Add Browsersync for frontend dev and update ignores.
  • Loading branch information
UTCGilligan authored Nov 14, 2023
2 parents e58cd28 + f73906c commit 95ae54d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@
.htaccess
includes/vendor/*
!includes/vendor/.gitkeep

# environment-specific config
user/config.php

# frontend tooling
frontend/node_modules
frontend/package-lock.json

# SQL
*.sql
*.sql.gz
Expand Down
10 changes: 8 additions & 2 deletions frontend/gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
var gulp = require('gulp');
var sass = require('gulp-sass')(require('sass'));
var browserSync = require('browser-sync').create();

gulp.task('sass', () => {
return gulp.src("./assets/sass/*.scss")
return gulp.src("assets/sass/*.scss")
.pipe(sass())
.pipe(gulp.dest("dist/"))
.pipe(browserSync.stream());
});

gulp.task('start', gulp.series('sass', function () {
gulp.watch("sass/*.scss", gulp.series('sass'));
browserSync.init({
proxy: "utctiny.lndo.site"
});
gulp.watch("assets/sass/*.scss", gulp.series('sass'));
gulp.watch("*.php").on('change', browserSync.reload);
}));

gulp.task('default', gulp.series('start'));
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"author": "",
"license": "ISC",
"devDependencies": {
"browser-sync": "^2.29.3",
"gulp": "^4.0.2",
"gulp-sass": "^5.0.0",
"sass": "^1.35.1"
Expand Down

0 comments on commit 95ae54d

Please sign in to comment.