diff mbox series

[4/5] web-app: update gulp to ES6

Message ID 20240224140031.9888-5-daniel@braunwarth.dev
State Accepted
Delegated to: Stefano Babic
Headers show
Series web-app: update web application | expand

Commit Message

Daniel Braunwarth Feb. 24, 2024, 2 p.m. UTC
Signed-off-by: Daniel Braunwarth <daniel@braunwarth.dev>
---
 web-app/{gulpfile.js => gulpfile.mjs} | 32 ++++++++++++++-------------
 1 file changed, 17 insertions(+), 15 deletions(-)
 rename web-app/{gulpfile.js => gulpfile.mjs} (83%)
diff mbox series

Patch

diff --git a/web-app/gulpfile.js b/web-app/gulpfile.mjs
similarity index 83%
rename from web-app/gulpfile.js
rename to web-app/gulpfile.mjs
index a698e81..9befddf 100755
--- a/web-app/gulpfile.js
+++ b/web-app/gulpfile.mjs
@@ -5,20 +5,22 @@ 
  * SPDX-License-Identifier: MIT
  */
 
-const cleanCSS = require('gulp-clean-css')
-const del = require('del')
-const gulp = require('gulp')
-const gzip = require('gulp-gzip')
-const imagemin = require('gulp-imagemin')
-const filter = require('gulp-filter')
-const htmlmin = require('gulp-htmlmin')
-const minify = require('gulp-minify')
-const rename = require('gulp-rename')
-const replace = require('gulp-replace')
-const sass = require('gulp-sass')(require('sass'))
-const tar = require('gulp-tar')
-const useref = require('gulp-useref')
-const minimist = require('minimist')
+import cleanCSS from 'gulp-clean-css'
+import { deleteAsync } from 'del'
+import gulp from 'gulp'
+import gzip from 'gulp-gzip'
+import imagemin from 'gulp-imagemin'
+import filter from 'gulp-filter'
+import htmlmin from 'gulp-htmlmin'
+import minify from 'gulp-minify'
+import rename from 'gulp-rename'
+import replace from 'gulp-replace'
+import * as dartSass from 'sass'
+import gulpSass from 'gulp-sass'
+import tar from 'gulp-tar'
+import useref from 'gulp-useref'
+import minimist from 'minimist'
+const sass = gulpSass(dartSass)
 
 const knownOptions = {
   string: 'output',
@@ -122,7 +124,7 @@  gulp.task('package', function () {
 })
 
 gulp.task('clean', function () {
-  return del('dist/**', { force: true })
+  return deleteAsync(['dist/**'])
 })
 
 gulp.task('build', gulp.series('clean', gulp.parallel('copy-css', 'copy-js', 'copy-fonts', 'sass', 'minify-css', 'minify-js', 'minify-html', 'resize-images')))