Здравствуйте, хочу перенести файл index.html из папки src в папку dist.
Код написанный ранее:
"use strict";
const {src, dest} = require("gulp");
const gulp = require("gulp");
const autoprefixer = require("gulp-autoprefixer");
const cssbeautify = require("gulp-cssbeautify");
const removeComments = require("gulp-strip-css-comments");
const rename = require("gulp-rename");
const sass = require("gulp-sass");
const cssnano = require("gulp-cssnano");
const rigger = require("gulp-rigger");
const uglify = require("gulp-uglify");
const plumber = require("gulp-plumber");
const imagemin = require("gulp-imagemin");
const del = require("del");
const panini = require("panini");
const browsersync = require("browser-sync").create();
var path = {
build: {
html: "dist/",
js: "dist/assets/js/",
css: "dist/assets/css/",
images: "dist/assets/img/"
},
src: {
html: "src/*.html",
js: "src/assets/js/*.js",
css: "src/assets/sass/style.scss",
images: "src/assets/img/**/*.{jpg,png,svg,gif,ico}"
},
watch: {
html: "src/**/*.html",
js: "src/assets/js/**/*.js",
css: "src/assets/sass/**/*.scss",
images: "src/assets/img/**/*.{jpg,png,svg,gif,ico}"
},
clean: "./dist"
}
function html() {
return src(path.src.html, {base: "src/"})
.pipe(dest(path.build.html));
}
exports.html = html;
__________________________________________
Подскажите пожалуйста в чём может быть ошибка в терминале?
PS C:\lessons\gulp-web> gulp html Error [ERR_REQUIRE_ESM]: require() of ES Module C:\lessons\gulp-web\node_modules\gulp-imagemin\index.js from C:\lessons\gulp-web\gulpfile.js not supported.Instead change the require of index.js in C:\lessons\gulp-web\gulpfile.js to a dynamic import() which is available in all CommonJS modules. at Object. (C:\lessons\gulp-web\gulpfile.js:14:18) at async Promise.all (index 0) { code: 'ERR_REQUIRE_ESM'