Skip to content

Commit

Permalink
Remove unused npm packages, remove browsersync
Browse files Browse the repository at this point in the history
Signed-off-by: James Hunt <[email protected]>
  • Loading branch information
thetwopct committed Jun 28, 2024
1 parent babab7b commit bf5fb1d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1,664 deletions.
7 changes: 1 addition & 6 deletions web/wp-content/themes/lfevents/config-default.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
# Server build process looks for this file - config-default.yml.
# To setup browsersync or change settings for your environment, duplicate this file and rename to config.yml. This will override default, but is not committed to the repo.

# Browsersync config
BROWSERSYNC:
# URL of local development server goes here (ex. http://localsite.dev)
url: ""
# To change settings for your environment, duplicate this file and rename to config.yml. This will override default, but is not committed to the repo.

# Gulp will reference these paths when it copies files
PATHS:
Expand Down
32 changes: 4 additions & 28 deletions web/wp-content/themes/lfevents/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
const gulp = require('gulp');
const terser = require('gulp-terser');
const yargs = require('yargs');
const browser = require('browser-sync').create();
const rimraf = require('rimraf');
const yaml = require('js-yaml');
const fs = require('fs');
Expand Down Expand Up @@ -32,7 +31,7 @@ function loadConfig() {
}
}

const { BROWSERSYNC, PATHS } = loadConfig();
const { PATHS } = loadConfig();
const PRODUCTION = !!(yargs.argv.production);

// Delete the "dist" folder. This happens every time a build starts.
Expand Down Expand Up @@ -63,38 +62,18 @@ function compileCSS() {
suffix: '.min'
}))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest(PATHS.dist + '/css'))
.pipe(browser.reload({
stream: true
}));
}

// Start BrowserSync to preview the site in browser.
function server(done) {
browser.init({
proxy: BROWSERSYNC.url,
ui: {
port: 8080
},
});
done();
}

// Reload the browser with BrowserSync.
function reload(done) {
browser.reload();
done();
.pipe(gulp.dest(PATHS.dist + '/css'));
}

// Watch for changes to static assets, pages, Sass, and JavaScript
function watch() {
gulp.watch('src/scss/**/*.scss', compileCSS)
.on('change', path => log('File ' + colors.bold(colors.magenta(path)) + ' changed.'))
.on('unlink', path => log('File ' + colors.bold(colors.magenta(path)) + ' was removed.'));
gulp.watch('**/*.php', reload)
gulp.watch('**/*.php')
.on('change', path => log('File ' + colors.bold(colors.magenta(path)) + ' changed.'))
.on('unlink', path => log('File ' + colors.bold(colors.magenta(path)) + ' was removed.'));
gulp.watch('src/images/**/*', gulp.series(reload));
gulp.watch('src/images/**/*');
}

const webpack = {
Expand All @@ -120,8 +99,6 @@ const webpack = {
log('[webpack]', stats.toString({
colors: true,
}));

browser.reload();
},
build() {
return gulp.src(PATHS.entries)
Expand Down Expand Up @@ -164,7 +141,6 @@ gulp.task('build', gulp.series(
// Default task
gulp.task('default', gulp.series(
'build',
server,
'webpack:watch',
watch
));
Loading

0 comments on commit bf5fb1d

Please sign in to comment.