RError.com

RError.com Logo RError.com Logo

RError.com Navigation

  • 主页

Mobile menu

Close
  • 主页
  • 系统&网络
    • 热门问题
    • 最新问题
    • 标签
  • Ubuntu
    • 热门问题
    • 最新问题
    • 标签
  • 帮助
主页 / 问题

问题[gulp]

Martin Hope
Sato
Asked: 2024-04-05 06:28:26 +0000 UTC

在 gulp 版本 5 中,复制图像时,输出损坏

  • 5

当我想将源代码中的图像复制到构建文件夹中时。我得到的输出是破碎的图像。

这是标准任务代码:

export const images = () => {
    return gulp
        .src(path.src.images)
        .pipe(plumber(plumberNotifySettings("IMAGES")))
        .pipe(newer(path.build.images))
        .pipe(debug({ title: 'Обработка изображения:' }))
        .pipe(imagemin(imageminOption))
        .pipe(gulp.dest(path.build.images))
        .pipe(browserSync.stream());
};

日志中说一切都正常处理,但最终却相反

我该如何解决?

gulp
  • 1 个回答
  • 108 Views
Martin Hope
rdy2fe
Asked: 2023-02-18 00:09:48 +0000 UTC

为什么没有安装 Gulp?

  • 5

大家下午好!Gulp 没有安装

我在这里提出了有关安装 Gulp 的问题,但我没有找到问题的答案(

节点版本 - 19.3.0,npm,npx - 9.2.0

我的操作:(npm init默认情况下用所有内容填充 package.json)npm install --save-dev gulp,. 之后,控制台中显示以下内容:

npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated

npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated

npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated

npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies

npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated

added 350 packages, and audited 351 packages in 14s

12 packages are looking for funding
  run `npm fund` for details

6 high severity vulnerabilities

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

最后 Gulp 没有安装。

都试过了npm audit fix,和npm audit fix --force。没有任何帮助。

也许有人可以建议如何解决这个问题?

PS 在全局和本地都删除了 Gulp,没有帮助。

gulp
  • 1 个回答
  • 14 Views
Martin Hope
Konstantin_SH
Asked: 2022-09-18 21:31:14 +0000 UTC

如何使用 gulp 从链接下载 zip 存档?

  • 0

我正在尝试使用插件gulp-download和最新版本的 wordpress 下载并解压缩存档gulp-decompress,但在下载阶段,控制台不断出现

不明确的%

在这种情况下,如果您手动点击链接,下载就会开始。这是代码:

gulp.task("getWP", () => {
       let url ="https://uk.wordpress.org/latest-uk.zip"
       download(url).pipe(decompress()).pipe(dest(project.build.php));
   })

可能是什么问题呢?

gulp
  • 1 个回答
  • 10 Views
Martin Hope
Павел Рыбакин
Asked: 2022-07-05 21:37:46 +0000 UTC

帮助在 gulp 中嵌入 imagemin-webp

  • 0

无法将 alljpeg和png图片的转换嵌入到webp. 您需要确保所有图像都转换为文件夹dist,并且还创建了图像webp:

const gulp        = require('gulp');
const browserSync = require('browser-sync');
const sass        = require('gulp-sass');
const cleanCSS = require('gulp-clean-css');
const autoprefixer = require('gulp-autoprefixer');
const rename = require("gulp-rename");
const imagemin = require('gulp-imagemin');
const webp = require('imagemin-webp');
const htmlmin = require('gulp-htmlmin');
const extReplace = require("gulp-ext-replace");



gulp.task('server', function() {

    browserSync({
        server: {
            baseDir: "dist"
        }
    });

    gulp.watch("src/*.html").on('change', browserSync.reload);
});

gulp.task('styles', function() {
    return gulp.src("src/scss/**/*.+(scss|sass)")
        .pipe(sass({outputStyle: 'compressed'}).on('error', sass.logError))
        .pipe(rename({suffix: '.min', prefix: ''}))
        .pipe(autoprefixer())
        .pipe(cleanCSS({compatibility: 'ie8'}))
        .pipe(gulp.dest("dist/css"))
        .pipe(browserSync.stream());
});

gulp.task('watch', function() {
    gulp.watch("src/scss/**/*.+(scss|sass|css)", gulp.parallel('styles'));
    gulp.watch("src/*.html").on('change', gulp.parallel('html'));
    gulp.watch("src/js/**/*.js").on('change', gulp.parallel('scripts'));
    gulp.watch("src/fonts/**/*").on('all', gulp.parallel('fonts'));
    gulp.watch("src/icons/**/*").on('all', gulp.parallel('icons'));
    gulp.watch("src/img/**/*").on('all', gulp.parallel('images'));
});

gulp.task('html', function () {
    return gulp.src("src/*.html")
        .pipe(htmlmin({ collapseWhitespace: true }))
        .pipe(gulp.dest("dist/"));
});

gulp.task('scripts', function () {
    return gulp.src("src/js/**/*.js")
        .pipe(gulp.dest("dist/js"))
        .pipe(browserSync.stream());
});

gulp.task('fonts', function () {
    return gulp.src("src/fonts/**/*")
        .pipe(gulp.dest("dist/fonts"))
        .pipe(browserSync.stream());
});

gulp.task('icons', function () {
    return gulp.src("src/icons/**/*")
        .pipe(gulp.dest("dist/icons"))
        .pipe(browserSync.stream());
});

gulp.task('images', function () {
    return gulp.src("src/img/**/*")
        .pipe(imagemin())
        .pipe(gulp.dest("dist/img"))
        .pipe(browserSync.stream());
});

gulp.task('default', gulp.parallel('watch', 'server', 'styles', 'scripts', 'fonts', 'icons', 'html', 'images'));

gulp
  • 1 个回答
  • 10 Views
Martin Hope
Cygnus_bewickii
Asked: 2022-05-23 17:48:59 +0000 UTC

Gulp 找不到模块

  • 0

我最近设置了 gulp,并且在处理第一个项目时没有遇到任何问题。问题出现在将 gulp 转移到另一个项目的阶段。移动 gulp、src 和 package.json,在 VScode 中启动文件夹,然后使用 npm i 安装插件。但是,当直接在终端中使用“gulp”时,会出现此消息。来自终端的消息可以做些什么呢?

gulp
  • 1 个回答
  • 10 Views

Sidebar

Stats

  • 问题 10021
  • Answers 30001
  • 最佳答案 8000
  • 用户 6900
  • 常问
  • 回答
  • Marko Smith

    我看不懂措辞

    • 1 个回答
  • Marko Smith

    请求的模块“del”不提供名为“default”的导出

    • 3 个回答
  • Marko Smith

    "!+tab" 在 HTML 的 vs 代码中不起作用

    • 5 个回答
  • Marko Smith

    我正在尝试解决“猜词”的问题。Python

    • 2 个回答
  • Marko Smith

    可以使用哪些命令将当前指针移动到指定的提交而不更改工作目录中的文件?

    • 1 个回答
  • Marko Smith

    Python解析野莓

    • 1 个回答
  • Marko Smith

    问题:“警告:检查最新版本的 pip 时出错。”

    • 2 个回答
  • Marko Smith

    帮助编写一个用值填充变量的循环。解决这个问题

    • 2 个回答
  • Marko Smith

    尽管依赖数组为空,但在渲染上调用了 2 次 useEffect

    • 2 个回答
  • Marko Smith

    数据不通过 Telegram.WebApp.sendData 发送

    • 1 个回答
  • Martin Hope
    Alexandr_TT 2020年新年大赛! 2020-12-20 18:20:21 +0000 UTC
  • Martin Hope
    Alexandr_TT 圣诞树动画 2020-12-23 00:38:08 +0000 UTC
  • Martin Hope
    Air 究竟是什么标识了网站访问者? 2020-11-03 15:49:20 +0000 UTC
  • Martin Hope
    Qwertiy 号码显示 9223372036854775807 2020-07-11 18:16:49 +0000 UTC
  • Martin Hope
    user216109 如何为黑客设下陷阱,或充分击退攻击? 2020-05-10 02:22:52 +0000 UTC
  • Martin Hope
    Qwertiy 并变成3个无穷大 2020-11-06 07:15:57 +0000 UTC
  • Martin Hope
    koks_rs 什么是样板代码? 2020-10-27 15:43:19 +0000 UTC
  • Martin Hope
    Sirop4ik 向 git 提交发布的正确方法是什么? 2020-10-05 00:02:00 +0000 UTC
  • Martin Hope
    faoxis 为什么在这么多示例中函数都称为 foo? 2020-08-15 04:42:49 +0000 UTC
  • Martin Hope
    Pavel Mayorov 如何从事件或回调函数中返回值?或者至少等他们完成。 2020-08-11 16:49:28 +0000 UTC

热门标签

javascript python java php c# c++ html android jquery mysql

Explore

  • 主页
  • 问题
    • 热门问题
    • 最新问题
  • 标签
  • 帮助

Footer

RError.com

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

帮助

© 2023 RError.com All Rights Reserve   沪ICP备12040472号-5