Ошибка:
file:///C:/Users/dench/OneDrive/fls/fls/config/gulp-tasks/css.js:2
import del from "del";
^^^
SyntaxError: The requested module 'del' does not provide an export named 'default'
at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:190:5)
package.json
{
"name": "fls-start",
"version": "3.0.0",
"description": "Start template with Gulp and Webpack",
"author": "FLS",
"private": true,
"license": "",
"type": "module",
"scripts": {
"dev": "gulp && webpack serve --progress -c config/webpack.dev.js",
"build": "gulp build --build",
"sprite": "gulp sprite",
"fonts": "gulp fonts --rewrite",
"deploy": "gulp deployFTP --build",
"zip": "gulp deployZIP --build",
"devbuild": "gulp build --build --nowebp",
"tmp": "gulp -f gulpfile.tmp.js",
"bem": "fls-bemtree-from-html"
},
"devDependencies": {
"copy-webpack-plugin": "latest",
"css-loader": "latest",
"del": "latest",
"file-include-webpack-plugin-replace": "latest",
"fls-bemtree-from-html": "^1.0.0",
"gulp": "latest",
"gulp-autoprefixer": "latest",
"gulp-clean-css": "latest",
"gulp-fonter-fix": "latest",
"gulp-group-css-media-queries": "latest",
"gulp-if": "latest",
"gulp-imagemin": "latest",
"gulp-newer": "latest",
"gulp-notify": "latest",
"gulp-plumber": "latest",
"gulp-prettier": "latest",
"gulp-rename": "latest",
"gulp-svg-sprite": "latest",
"gulp-ttf2woff": "latest",
"gulp-ttf2woff2": "latest",
"gulp-util": "latest",
"gulp-version-number": "latest",
"gulp-webp": "latest",
"gulp-webp-html-nosvg": "latest",
"gulp-webpcss": "latest",
"gulp-zip": "latest",
"html-webpack-plugin": "latest",
"inputmask": "latest",
"lightgallery": "latest",
"load-plugins": "latest",
"mini-css-extract-plugin": "2.4.7",
"nouislider": "latest",
"pug": "latest",
"pug-loader": "latest",
"sass": "latest",
"sass-loader": "latest",
"smooth-scroll": "latest",
"string-replace-loader": "latest",
"style-loader": "latest",
"swiper": "latest",
"terser-webpack-plugin": "latest",
"tippy.js": "latest",
"transform-runtime": "0.0.0",
"vanilla-lazyload": "latest",
"vinyl-ftp": "latest",
"webp-converter": "2.2.3",
"webpack": "latest",
"webpack-cli": "latest",
"webpack-dev-server": "latest",
"webpack-stream": "latest"
},
"dependencies": {
"simplebar": "latest"
}
}
gulpfile.js
// Импорт основного модуля
import gulp from "gulp";
// Импорт общих плагинов
import { plugins } from "./config/gulp-plugins.js";
// Импорт путей
import { path } from "./config/gulp-settings.js";
// Передаем значения в глобальную переменную
global.app = {
isBuild: process.argv.includes('--build'),
isDev: !process.argv.includes('--build'),
isWebP: !process.argv.includes('--nowebp'),
isFontsReW: process.argv.includes('--rewrite'),
gulp: gulp,
path: path,
plugins: plugins
}
// Импорт задач
import { reset } from "./config/gulp-tasks/reset.js";
import { html } from "./config/gulp-tasks/html.js";
import { css } from "./config/gulp-tasks/css.js";
import { js } from "./config/gulp-tasks/js.js";
import { jsDev } from "./config/gulp-tasks/js-dev.js";
import { images } from "./config/gulp-tasks/images.js";
import { ftp } from "./config/gulp-tasks/ftp.js";
import { zip } from "./config/gulp-tasks/zip.js";
import { sprite } from "./config/gulp-tasks/sprite.js";
import { gitignore } from "./config/gulp-tasks/gitignore.js";
import { otfToTtf, ttfToWoff, fonstStyle } from "./config/gulp-tasks/fonts.js";
// Последовательная обработака шрифтов
const fonts = gulp.series(reset, otfToTtf, ttfToWoff, fonstStyle);
// Основные задачи будем выполнять параллельно после обработки шрифтов
const devTasks = gulp.parallel(fonts, gitignore);
// Основные задачи будем выполнять параллельно после обработки шрифтов
const buildTasks = gulp.series(fonts, jsDev, js, gulp.parallel(html, css, images, gitignore));
const del = require("del");
function clean() {
return del(["dist"]);
}
exports.clean = clean;
// Экспорт задач
export { html }
export { css }
export { js }
export { jsDev }
export { images }
export { fonts }
export { sprite }
export { ftp }
export { zip }
// Построение сценариев выполнения задач
const development = gulp.series(devTasks);
const build = gulp.series(buildTasks);
const deployFTP = gulp.series(buildTasks, ftp);
const deployZIP = gulp.series(buildTasks, zip);
// Экспорт сценариев
export { development }
export { build }
export { deployFTP }
export { deployZIP }
// Выполнение сценария по умолчанию
gulp.task('default', development);
reset.js
import del from "del";
export const reset = () => {
return del(app.path.clean);
}