gulp

Laravel Elixir 6 getting exception on “gulp watch”

删除回忆录丶 提交于 2019-12-11 00:37:39
问题 When I try to run gulp watch , I'm getting this error: stream.js:74 throw er; // Unhandled stream error in pipe. ^ Error: ENOENT: no such file or directory, stat 'XXXX\public\build\css\client-18724fe72d.css' at Error (native) I tried to leave the client.scss file empty, and the error disappeared. I found out that the errors sometimes is appearing when I have these lines in my client.scss : // Pages @import 'pages/client/auth'; @import 'pages/client/normals'; @import 'pages/client/orders'; I

Run gulp from child directories?

假如想象 提交于 2019-12-11 00:36:59
问题 I currently have a file structure like this SASS gulpfile.js node_modules sites example-site scss css example-site-two scss css example-site-three scss css I have gulp installed in the main parent SASS folder with a task 'sass-all' that can go through every single sites scss folder and compile it into css. I'm trying to write a new task called 'sass-single' which can be run from any of the example-site folders. So let's say I'm in the folder "example-site-two", I want to be able to cmd and do

Error running gulp on Windows 10

被刻印的时光 ゝ 提交于 2019-12-11 00:23:49
问题 I'm running Windows 10 build 10576 (latest) and I get an error when running gulp from my project root folder(or anywhere). Here's a screenshot of the error: http://puu.sh/l3mLf/522a4e6dbe.png Error message says " invalid character ". (I've installed gulp globally) The very first line of gulp.js in the bin folder is the following: #!/usr/bin/env node I didn't have this problem before and I'd really want to get this sorted out. Thanks. 回答1: I have the same error when try running "node_modules

Make gulp.js open non-default browser

笑着哭i 提交于 2019-12-10 23:15:21
问题 The title pretty much says it all. I'm on Windows 10, and I have a node app that I start with npm start . (I know almost nothing about node.js.) The app runs on gulp.js. I need the app to open in Firefox, even though Chrome is my default browser. How can I do this? Here's the code that opens the app now; the docs don't allude to there being such an option for the open parameter: gulp.task('webserver', function() { gulp.src('./app') .pipe(webserver({ livereload: true, open: true, defaultFile:

Can't use gulp (with gulp-connect-php and gulp-browser-sync) with multiple projects

只愿长相守 提交于 2019-12-10 22:08:44
问题 I've recently started using gulp and have a nice workflow but when I added the gulpfile to a new project, every time I run gulp from the original project directory, it serves the newest project and I have no idea what I've done. This should be the relevant contents of my gulpfile: var gulp = require('gulp'); /* etc. */ gulp.task('default', function(callback) { runSequence(['connect-sync'], callback ) }); gulp.task('connect-sync', function() { connect.server({ base: 'app' /* tried ./app */ },

gulp-filter filters out all files

与世无争的帅哥 提交于 2019-12-10 20:48:30
问题 I'm working on moving my workflow over to Gulp, and I'm loving it so far; however, I seem to have misunderstood something about how the gulp-filter plugin works... I have the following task: gulp.task('assets', function() { var stylesFilter = gulpFilter(stylesPath); var imagesFilter = gulpFilter(imagesPath); var scriptsFilter = gulpFilter(scriptsPath); return gulp.src([].concat('app/**/*.html', stylesPath, imagesPath, scriptsPath)) // STYLES .pipe(stylesFilter) .pipe(gulp.dest('dist/test

gulp task to process files that are writable

北城以北 提交于 2019-12-10 19:43:24
问题 I'm using Gulp in a VS2015 project to run jscs on JavaScript files with the fix option set. The intention is to modify the same file that is read (viz., source and destination are the same). var gulp = require('gulp'); var jscs = require('gulp-jscs'); var chmod = require('gulp-chmod'); var exec = require('gulp-exec'); var ourJsFiles = // an array of files and globbed paths gulp.task('jscs', function (callback) { ourJsFiles.forEach(function (fn) { gulp.src(fn, { base: './' }) .pipe(jscs({

Gulp 4 & BrowserSync: Style Injection?

▼魔方 西西 提交于 2019-12-10 18:48:06
问题 I'm attempting to use browser-sync with Gulp 4, but bs is not preserving state, and instead does a full refresh. This is not very useful. It seems bs no longer supports true injection. I filed an issue on GH if you want to contribute. Here is the pertinent code: // styles:dev task gulp.task('styles:dev', function() { return gulp.src(config.src) .pipe(sourcemaps.init()) .pipe(postcss(config.postcss.dev)) .pipe(sourcemaps.write('.')) .pipe(gulp.dest(config.dest.dev)) .pipe(browserSync.stream())

gulp: passing dependent task return stream as parameter

感情迁移 提交于 2019-12-10 18:45:53
问题 I'm trying to create two gulp tasks, and I'd like the second task to take the first one's output stream and keep applying plugins to it. Can I pass the first task's return value to the second task? The following doesn't work: // first task to be run gulp.task('concat', function() { // returning a value to signal this is sync return gulp.src(['./src/js/*.js']) .pipe(concat('app.js')) .pipe(gulp.dest('./src')); }; // second task to be run // adding dependency gulp.task('minify', ['concat'],

gulp常用插件之autoprefixer使用

让人想犯罪 __ 提交于 2019-12-10 18:43:58
更多gulp常用插件使用请访问: gulp常用插件汇总 autoprefixer 这是一款自动管理浏览器前缀的插件,它可以解析CSS文件并且添加浏览器前缀到CSS内容里。 更多使用文档请点击访问autoprefixer工具官网 。 安装 一键安装不多解释 npm install --save-dev autoprefixer 使用 autoprefixer(options)就是调用啦,options是个object。 autoprefixer(options) 如何在gulpfile.js文件里使用呢?其实也很简单,请看: const gulp = require('gulp'); const autoprefixer = require('autoprefixer'); gulp.task('default', () => gulp.src('./before/css.css') .pipe(autoprefixer({ browsers:['> 1%', 'last 2 versions', 'Firefox ESR'], // 重要配置 详见下面 cascade: false // 是否美化属性值 })) .pipe(gulp.dest('./before/dist')) ); 其实这样就算使用autoprefixer了,是不是很简单。 控制注释