gulp

Node's del command - callback not firing

怎甘沉沦 提交于 2019-11-29 16:38:46
问题 I'm working through a pluralsight course on gulp. John Papa is demonstrating how to inject a function that deletes existing css files, into the routine that compiles the new ones. The callback on the del function is not firing. The del function is running, file are deleted, I see no error messages. If I call the callback manually it executes, so looks like the function is in tact. So I am wondering what would cause del not to want to execute the callback. delete routine: function clean(path,

gulp watch doesn't watch

烈酒焚心 提交于 2019-11-29 16:22:31
Following is my gulpfile.js. There are a couple of more tasks in it and all are working fine - but the last task, watch doesn't. I've tried every possible combination of paths and files and what so ever, but still I don't have luck. I've read many answers on this here, but couldn't solve my problem. I tried to run gulp.watch with and without requiring gulp-watch, tried several different approaches on how to set up the task and so on and so on... var gulp = require('gulp'); var browserify = require('browserify'); var babelify = require('babelify'); var source = require('vinyl-source-stream');

Gulp Changed doesn't work

怎甘沉沦 提交于 2019-11-29 15:00:42
I have previously used gulp changed with my JS without a problem. However now I am trying to use gulp-changed and gulp-newer on my scss files without it detecting which file has changed. var changed = require('gulp-changed'); var newer = require('gulp-newer'); var SRC = './stylesheets/**/*.scss'; var DEST = './stylesheets'; gulp.task('sass', function () { return gulp.src(SRC) .pipe(changed(DEST)) //tried newer here as well .pipe(sass()) .pipe(gulp.dest(DEST)) }); When changing a scss file it will output there has been a change but not change any scss [BS] Watching files... [09:26:13] Starting

How to compose sequence of pipes for gulp?

匆匆过客 提交于 2019-11-29 14:57:38
I have a common pattern in my gulpfile.js : var rev = require('gulp-rev'); var buffer = require('gulp-buffer'); gulp.src.some_stuff .pipe(anotherStuff) .pipe(buffer()) // this line & 4 lines down .pipe(rev()) .pipe(gulp.dest(options.dest)) .pipe(rev.manifest({ path: 'manifest.json', merge: true })) .pipe(gulp.dest(options.dest)) // to this .pipe(extrastuff) I want to compose these 5 lines to reuse them in my project over a couple of gulp tasks. How can I do that? I found multipipe package but it doesn't support passing variables to new pipes (you can see I need to pass options.dest in my new

node sass release 3.5.3 is breaking build

£可爱£侵袭症+ 提交于 2019-11-29 14:46:15
This is also currently biting my project, which uses gulp-sass. gulp-sass depends on node-sass#^3.4.1 which just automatically updated to 3.5.3 which is a breaking release. I have degraded my gulp sass version to the older(2.1.0) by updating the package.json file but its still breaking. how to go back to node sass 3.4.2? Error Message Error: You may not @extend an outer selector from within @media. You may only @extend selectors within the same directive. { "version": "1.0.0", "name": "abcd", "devDependencies": { "bower": "^1.3.12", "express": "^4.12.3", "gulp": "^3.8.10", "gulp-autoprefixer":

Gulp-generated source maps don't work in Chrome

只谈情不闲聊 提交于 2019-11-29 13:21:39
Apart from enabling source maps in Chrome, in my gulpfile.js I use errLogToConsole: true, sourceComments: 'map', sourceMap: 'sass' as arguments when calling sass based on this answer : gulp.task('sass', function() { return gulp.src('../assets/styles/**/*.scss') .pipe(plumber({ errorHandler: onError })) .pipe(sass({errLogToConsole: true, sourceComments: 'map', sourceMap: 'sass'})) .pipe(autoprefixer()) .pipe(gulp.dest('../dist/styles')) .pipe(browserSync.reload({ stream: true })) }); Yet SCSS content still doesn't show up in DevTools. Why? Note: source map comments do show up in compiled CSS as

构建工具-Gulp 相关知识

▼魔方 西西 提交于 2019-11-29 12:36:29
layout: layout title: 『构建工具-Gulp』相关内容整理 date: 2017-04-26 22:15:46 tags: Gulp categories: Tools --- Gulp- 简介 Automate and enhance your workflow | 用自动化构建工具增强你的工作流程 Gulp 是什么? gulp是前端开发过程中一种基于流的代码构建工具,是自动化项目的构建利器;它不仅能对网站资源进行优化,而且在开发过程中很多重复的任务能够使用正确的工具自动完成; 使用它,不仅可以很愉快的编写代码,而且大大提高我们的工作效率。 gulp是基于Nodejs的自动任务运行器,它能自动化地完成 javascript、coffee、sass、less、html/image、css 等文件的测试、检查、合并、压缩、格式化、浏览器自动刷新、部署文件生成,并监听文件在改动后重复指定的这些步骤。在实现上,她借鉴了Unix操作系统的管道(pipe)思想,前一级的输出,直接变成后一级的输入,使得在操作上非常简单。通过本文,我们将学习如何使用Gulp来改变开发流程,从而使开发更加快速高效。 gulp 和 grunt 非常类似,但相比于 grunt 的频繁 IO 操作,gulp 的流操作,能更快地更便捷地完成构建工作。 Gulp的核心概念? 流

Switching from Gulp to Webpack

人盡茶涼 提交于 2019-11-29 11:45:46
问题 My first question is about how recommended is this switch for simple projects, just to Pre-Process/Concat/Minify? Understanding this future "standards", like Webpack in together with PostCss-NextCss-Autoprefixer, etc. is like obsessing me.... So this leads to my next question , is there any tutorial that will guide to simple tasks like the one I told in my first question? Or is an easy way to change my gulpfile.js to a webpack-config.js My normal tasks in gulp are not the best practices but

Typescript2 path module resolution

爱⌒轻易说出口 提交于 2019-11-29 11:42:19
tl;dr : module resolution does not apply ? Hello, I am playing around with Typescript2 module resolution feature. I've noticed that it is now possible to specify "Paths", so that you can do the following : Old way import {a} from "../../../foo" New way import {a} from "services/foo" To do so, you need to add some configs to your tsconfig.json "compilerOptions": { "baseUrl": ".", "paths": { "services/*": ["./application/core/services/*"], } } Problem that I have, is that when compiled, the import actually doesn't change. My javascript output still contains that import from "services/foo", so

How do I output gulp results to console?

时光总嘲笑我的痴心妄想 提交于 2019-11-29 11:18:47
问题 I want to put my spellcheck results out to the console instead of to a file and I think this should work since as I understand it gulp returns a stream. Instead I get an error: TypeError: Object #<Stream> has no method 'read' Here is my code gulp.task('spellcheck', function() { var patterns = [{ // Strip tags from HTML pattern: /(<([^>]+)>)/ig, replacement: '' }]; var spellSuggestions = [{ pattern: / [^ ]+? \(suggestions:[A-z, ']+\)/g, replacement: function(match) { return '<<<' + match + '>>