gulp

gulp with gulp-ruby-sass: Error: ../style.css.map:3:1: Unknown word

让人想犯罪 __ 提交于 2019-11-28 23:10:36
问题 Getting a strange error using a basic gulp/express build watch. Directory Layout project/ - sass/ - style.scss - gulpfile.js - index.html Gulpfile.js var gulp = require('gulp'), sass = require('gulp-ruby-sass'), autoprefixer = require('gulp-autoprefixer'), minifycss = require('gulp-minify-css'), rename = require('gulp-rename'); gulp.task('express', function() { var express = require('express'); var app = express(); app.use(require('connect-livereload')({port: 4002})); app.use(express.static(_

Browsersync within a Docker container

点点圈 提交于 2019-11-28 23:07:03
问题 I've got a Wordpress/MySQL docker container, which I use for developing themes & plugins. I access this on localhost:8000. It uses a Gulp build process & I am trying to add browsersync to the mix. I'm having a hard time getting the browsersync to actually proxy out of the container. From the Gulp output I can see that its generating the changes, just not actually making any changes in the browser. Heres my docker-compose.yml, gulpfile, dockerfile & shell script. version: '2' services:

gulp-jshint: How to fail the build?

南笙酒味 提交于 2019-11-28 22:41:23
I want my Gulp build to fail, if there are errors in JSHint. According to the documentation of gulp-jshint I can use the "fail reporter". However the following does not work: gulp.task("lint", function() { return gulp.src(JS_SOURCES) .pipe(jshint()) .pipe(jshint.reporter("jshint-stylish")) .pipe(jshint.reporter("fail")); }); The task above always returns with exit code 0, even when there are errors in JSHint. I am using gulp 3.8.10 and gulp-jshint 1.9.0. There are discussions in the github issues of gulp-jshint here and here ... but according those discussions I gather that above code should

Gulp 4 - Gulpfile.js set up

天涯浪子 提交于 2019-11-28 21:41:33
问题 I'm finding documentation on Gulp 4 extremely hard to find so I thought I might ask here to see if anyone can help. I'm pretty new to Gulp anyway and have been using Gulp 3 without any problems until I tried running it on a virtual machine we use for development. My gulp file is very straight forward I just use gulp-sass to compile SASS to a css file which was working fine but every time it saves the css file it changes the write permissions on the file and the browser can't read the file! So

How can I separate generated artifacts from the main build with semantic UI?

ぐ巨炮叔叔 提交于 2019-11-28 21:35:12
I am trying to figure out how to integrate Semantic UI with my gulp-based frontend toolchain. The npm artifact semantic-ui includes an interactive installer that will write a semantic.json file to the root of my project and install the less files, gulp tasks and some configuration into my project. All of these files will be put in subdirectories of a single base directory specified in semantic.json. I do not want any dependency implementation files or any generated files in the git repository for my project because this will pollute revision history and lead to unneccessary merge conflicts. I

How to run a task ONLY on modified file with Gulp watch

会有一股神秘感。 提交于 2019-11-28 21:01:05
I have the current gulp task which I use in a gulpfile. Path are from a config.json and everything works perfectly: //Some more code and vars... gulp.task('watch', function() { gulp.watch([config.path.devfolder+"/**/*.png", config.path.devfolder+"/**/*.jpg", config.path.devfolder+"/**/*.gif", config.path.devfolder+"/**/*.jpeg"], ['imagemin-cfg']); }) //Some more code ... gulp.task('imagemin-cfg', function () { return gulp.src([config.path.devfolder+"/**/*.png", config.path.devfolder+"/**/*.jpg", config.path.devfolder+"/**/*.gif", config.path.devfolder+"/**/*.jpeg"], {read: false}) .pipe

How to Increment Version Number via Gulp Task?

一世执手 提交于 2019-11-28 19:33:47
I would like to replace a string indicating version number in a javascript file ( myConstantsFile.js ), with another string. So, for example, my version number looks like this: "01.11.15", written like this in myConstantsFile.js with other constants: .constant('productVersion', '1.11.15'); Right now, my task looks like this: gulp.task('increment-version', function(){ gulp.src(['./somedir/myConstantsFile.js']) .pipe(replace(/'productVersion', '(.*)'/g, '99.99.99')) .pipe(gulp.dest('./somedir/')); }); As you can see, I am using a constant, not running incrementation code , which would look like

Glob / minimatch: how to gulp.src() everything, then exclude folder but keep one file in it

↘锁芯ラ 提交于 2019-11-28 19:10:53
I have a project like this: root |-incl1 |-incl2 |- ... |-excl1 |-excl2 |- .gitignore <-- keep this one |- (other files) <-- exclude them I need to write gulp.src() that will include all folders except excl1 and excl2 but keep the .gitignore file. This is my code that doesn't work: gulp.src([ baseDir + '/**', '!' + baseDir + '/{excl1, excl1/**}' '!' + baseDir + '/excl2/{**, !.gitignore}' // <-- doesn't work ], {dot: true}) Heikki This seems to work: gulp.src([ baseDir + '/**', // Include all '!' + baseDir + '/excl1{,/**}', // Exclude excl1 dir '!' + baseDir + '/excl2/**/!(.gitignore)', //

Iterating over directories with Gulp?

妖精的绣舞 提交于 2019-11-28 19:10:12
I'm new to gulp , but I'm wondering if its possible to iterate through directories in a gulp task. Here's what I mean, I know a lot of the tutorials / demos show processing a bunch of JavaScript files using something like "**/*.js" and then they compile it into a single JavaScript file. But I want to iterate over a set of directories, and compile each directory into it's own JS file. For instance, I have a file structure like: /js/feature1/something.js /js/feature1/else.js /js/feature1/foo/bar.js /js/feature1/foo/bar2.js /js/feature2/another-thing.js /js/feature2/yet-again.js ...And I want two

How to add src files in the middle of a pipe

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-28 19:08:59
I want to process some files with 'coffee', add some js files, concat and minify. This does not work, coffee fails on the regular js files: gulp.task 'build-js', -> gulp.src([ "bower_components/mbdev-core/dist/js/db.js" "bower_components/mbdev-core/dist/js/utils.js" "src/js/config/app.coffee" "src/js/config/app-db.coffee" "src/js/accounts/accounts.coffee" "src/js/budget_items/budget_items.coffee" "src/js/line_items/line_items.coffee" "src/js/misc/misc.coffee" "src/js/reports/report_generators.coffee" "src/js/reports/reports.coffee" ]) .pipe(coffee()).on('error', gutil.log) .pipe(concat('app.js