gulp

Gulp: How to set dest folder relative to processed file (when using wildcards)?

主宰稳场 提交于 2019-12-10 00:58:27
问题 Under my assets/ folder, I have numerous subfolders, each containing an arbitrary number of images, like so: assets/article1/ assets/article2/ I'm trying to write a gulp task to locate all .jpg images within and generate their thumbnail versions, to be saved in a thumbs/ subfolder within the folder where each file resides: assets/article1/ # original jpg images assets/article1/thumbs/ # thumbnail versions of above.. assets/article2/ assets/article2/thumbs/ I've been trying various approaches

How to batch similar gulp tasks to reduce code repetition

我的未来我决定 提交于 2019-12-09 23:45:31
问题 I have written a gulp file that watches over several directories for changes, and then create concatenation to multiple specified destination. Here is a simplified version of my project structure: I have 2 site folders: one/ and two/ Each site have two branch folders: a/ and b/ Inside each branch, there are three folders: inner/ , outer/ and web/ My task is to grab similar part files from the inner and outer folders, and concatenate them into relative web folders. Below is a simple example of

uglified files are not rewritten in html file using gulp-usemin

最后都变了- 提交于 2019-12-09 19:56:08
问题 I am facing a problem with gulp-usemin plugin. when usemin task is running it is concating and uglifying css and js files, but the uglified js files are not rewritten in html file though it is generated. I am sharing my gulpfile.js and index.html code . index.html before conversion <html> <head> <!-- build:css build/css --> <link rel="stylesheet" href="css/blue.css"> <link rel="stylesheet" href="css/green.css"> <link rel="stylesheet" href="css/orange.css"> <!-- endbuild --> <!-- build:js

Cant make gulp-notify to pop up a error message when gulp-jshint fail

落花浮王杯 提交于 2019-12-09 19:43:53
问题 So, was the whole day working on our new FE workflow, the main idea is to run a few tasks through a watcher, we will have our IDE's and a window with the browsers getting refreshed each time something change (scss, js, html, etc). So, we wont see nothing if all went good: the browser will get reload and we will keep working. But, we want to use gulp notify for errors, so in case we have something wrong, the notifier pop up will appear, and at that point, you can check the console and see the

Get relative path of the file for tasks in vscode

Deadly 提交于 2019-12-09 18:22:45
问题 I have a task defined in vscode's tasks.json file as following { "version": "0.1.0", "tasks": [ { "command": "gulp", "taskName": "eslint_task", "args": [ "eslint", "--file", "${file}" ], "echoCommand": true } ] } The ${file} is providing me the absolute path (starting from /Volumes in macOS) of the file on which I run this command. Is there any way I can get the relative path (Path starting from the workspace folder) of the same file instead? I already checked the official documentation for

Template was precompiled with an older version of Handlebars than the current runtime

左心房为你撑大大i 提交于 2019-12-09 17:58:50
问题 I have this error, but the different between this question and my question is that I'm using gulp instead grunt. First, my handlebar runtime is handlebars v4.0.5 (js file). The output of handlebar -v is 4.0.5 This is my gulpfile.js : var gulp = require('gulp'); var uglify = require('gulp-uglify'); var handlebars = require('gulp-handlebars'); var wrap = require('gulp-wrap'); var declare = require('gulp-declare'); var concat = require('gulp-concat'); gulp.task('default', ['templates','scripts']

Error running gulp-sass after update to Node v4.0.0

与世无争的帅哥 提交于 2019-12-09 17:32:59
问题 I updated to Node v4.0.0 and after when I run gulp in my projects I get an error with regards to gulp-sass/node-sass, as follows: Error: libsass bindings not found. Try reinstalling node-sass ? I've tried trashing all the node modules in the project and reinstalling, and I get some errors: npm WARN package.json package@0.0.0 No repository field. npm WARN package.json package@0.0.0 No license field. npm WARN deprecated CSSselect@0.4.1: the module is now available as 'css-select' npm WARN

gulp and karma, file karma.conf.js does not exist

跟風遠走 提交于 2019-12-09 16:55:54
问题 I have a basic AngularJS app and want to have all my terminal command run with gulp tasks eg $ gulp dev for the development server and $ gulp unitTest for testing etc. I have installed Gulp as per the Docs using $ npm install --save-dev gulp with my gulpfile.js in the root of the project file. I have also done the same for karma's install and config file. It is worth stating now that I want all the npm installs tagged with --save for easily move the project around the office and servers. When

gulp is Killed irregularly

孤者浪人 提交于 2019-12-09 16:28:46
问题 I have an issue when running gulp as it kills itself during the task. I'm not doing anything: > gulp build [11:25:34] Using gulpfile /app/app-base/frontend/gulpfile.js [11:25:34] Starting 'css-clean'... [11:25:34] Starting 'js-clean'... [11:25:34] Finished 'css-clean' after 5.99 ms [11:25:34] Starting 'css-build'... [11:25:34] Finished 'js-clean' after 17 ms [11:25:34] Starting 'js-build'... [11:25:35] Finished 'css-build' after 888 ms [11:25:35] Starting 'css'... [11:25:35] Finished 'css'

Browserify fails to create bundle with babelify transform (TypeError: Path must be a string.)

╄→гoц情女王★ 提交于 2019-12-09 15:55:43
问题 I've written a gulp task to compile my .jsx and .js scripts into a bundle using watchify and babelify as a transform. For some reason my gulp script seems to be choking on the transform and I'm not sure why: gulp.task('browserify', function() { var bundle = watchify(browserify('./app/jsx/client/index.jsx', { extensions: ['.js', '.jsx'], debug: process.env.NODE_ENV === 'development' })); bundle.transform(babelify); bundle.on('update', function() { rebundle(bundle); }); function rebundle(bundle