@Poundforpound

Ошибка [IMAGES] Error: File not found with singular glob?

Собирая первую gulp сборку по уроку и при создании imаges.js выскакивает такое сообщение

Терминал
$ gulp
[06:40:13] Using gulpfile ~\Desktop\Filancer_gulp\gulpfile.js
[06:40:13] Starting 'default'...
[06:40:13] Starting 'reset'...
[06:40:13] Finished 'reset' after 12 ms
[06:40:13] Starting 'copy'...
[06:40:13] Starting 'html'...
[06:40:13] Starting 'scss'...
[06:40:13] Starting 'js'...
[06:40:13] Starting 'images'...
[06:40:14] gulp-notify: [IMAGES] Error: File not found with singular glob: C:/Users/Barcelona/Desktop/Filancer_gulp/dist/img/ (if this was purposeful, use `allowEmpty` option)
[gulp-version-number] Output to file: gulp/version.json
[06:40:14] Finished 'html' after 463 ms
[06:40:14] Finished 'copy' after 465 ms
[06:40:14] Finished 'scss' after 465 ms
[06:40:14] asset app.min.js 140 KiB [emitted] (name: main)

webpack 5.88.2 compiled successfully
[06:40:14] Finished 'js' after 678 ms
[06:40:20] gulp-imagemin: Minified 0 images
[06:40:20] Finished 'images' after 6.36 s
[06:40:20] Starting 'watcher'...
[06:40:20] Starting 'server'...
[Browsersync] Access URLs:
-----------------------------------
Local: localhost:3000
External: 10.0.0.106:3000
-----------------------------------
UI: localhost:3001
UI External: localhost:3001
-----------------------------------


Изображения при этом успешно конвертируются.

Мой images.js

Images
import webp from "gulp-webp";
import imagemin from "gulp-imagemin";

export const images = () => {
	return app.gulp.src(app.path.src.images)
		.pipe(app.plugins.plumber(
			app.plugins.notify.onError({
				title: "IMAGES",
				message: "Error: <%= error.message %>"
			}))
		)
		.pipe(app.plugins.newer(app.path.build.images))
		.pipe(webp())
		.pipe(app.gulp.dest(app.path.build.images))
		.pipe(app.gulp.src(app.path.build.images))
		.pipe(app.plugins.newer(app.path.build.images))
		.pipe(imagemin({
			progressive: true,
			svgoPlugins: [{ removeViewBox: false }],
			interlaced: true,
			optimizationLevel: 3 // 0 to 7
		}))
		.pipe(app.gulp.dest(app.path.build.images))
		.pipe(app.gulp.src(app.path.src.svg))
		.pipe(app.gulp.dest(app.path.build.images))
		.pipe(app.plugins.browsersync.stream());
}


Пути на всякий случай

Пути
export const path = {
	build: {
		js: `${buildFolder}/js/`,
		css: `${buildFolder}/css/`,
		html: `${buildFolder}/`,
		images: `${buildFolder}/img/`,
		files: `${buildFolder}/files`,
	},
	src: {
		js: `${srcFolder}/js/app.js`,
		images: `${srcFolder}/img/**/*.{jpg,jpeg,png,gif,webp}`,
		svg: `${srcFolder}/img/**/*.svg`,
		scss: `${srcFolder}/scss/style.scss`,
		html: `${srcFolder}/*.html`, //.pug,
		files: `${srcFolder}/files/**/*.*`,
	},
	watch: {
		js: `${srcFolder}/scss/**/*.js`,
		scss: `${srcFolder}/scss/**/*.scss`,
		html: `${srcFolder}/**/*.html`, //.pug
		images: `${srcFolder}/img/**/*.{jpg,jpeg,png,svg,gif,ico,webp}`,
		files: `${srcFolder}/files/**/*.*`,
	},
	clean: buildFolder,
	buildFolder: buildFolder,
	srcFolder: srcFolder,
	rootFolder: rootFolder,
	ftp: ``
}
  • Вопрос задан
  • 100 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы