gulp

Gulp : Prepare dist folder and edit ini file

霸气de小男生 提交于 2019-12-23 16:24:49
问题 I am trying to create a gulp task responsible to : 1. clean dist folder previouly created 2. Copy some folder inside new dist folder 3. Edit a ini file inside dist folder to update a key var destination = './dist/test/v2'; // Copy ini file to dist folder gulp.task('prepareDelivery', function () { gulp.src([source + '/ini/app_sample.ini']).pipe(gulp.dest(destination + '/ini/')); }); // update version in ini file gulp.task('prepareAppIni', ['prepareDelivery'], function () { var config = ini

gulp-iconfont task not populating unicode value

ε祈祈猫儿з 提交于 2019-12-23 16:20:02
问题 I am moving over from grunt to gulp and am having problems with the gulp-iconfont library to create my icon font and stylesheet. Dependencies: "devDependencies": { "gulp": "^3.9.0", "gulp-iconfont": "^5.0.1" } Gulpfile: I have the following gulfile setup to build the font: var gulp = require('gulp'), iconfont = require('gulp-iconfont'); var paths = { fonts: 'site/fonts/', icons: 'site/fonts/icons/src/', styles: 'site/styles/', scripts: 'site/scripts/' }; gulp.task('icons', function(){ return

Gulp Browsersync and http-proxy-middleware in offline mode

本秂侑毒 提交于 2019-12-23 16:04:30
问题 Does Browsersync with http-proxy-middleware work offline if I am proxying to a localhost server? I have an angular app deployed at localhost:3000 making requests for an api-server deployed at localhost:8080 . The http requests to the api-server are proxied by Browsersync http-proxy-middleware . Everything works fine if I have internet connection but, if I go offline, I get the following error on gulp console: [HPM] Proxy error: ENOENT localhost:8080/data/pet And on browser console: Failed to

Piping concatenated Gulp stream file.contents to server (connect, express or http) response

孤者浪人 提交于 2019-12-23 15:15:40
问题 I suspect this comes from a limited understanding of streams but I've looked everywhere and cannot get it to work. In short, I want to take a Gulp stream and pass the concatenated contents of the stream to an express response directly without writing to the file system. This is how I got the idea (which works fine): app.get('*', function(req, res){ var stream = fs.createReadStream(__dirname + '/app/index.html'); stream.pipe(res); }); But I want to apply the same concept using a Gulp stream:

gulp.src() include files but ignore all folders

做~自己de王妃 提交于 2019-12-23 14:19:53
问题 There is certainly such a simple answer to this that I can't find anyone that's asked it before: What globbing pattern to include all the files in a folder but ignore ALL subfolders? gulp.src('*') includes all files and folders. I just want the files and would rather not have to exclude the folders individually. 回答1: If you want to include .dotFiles as well then try gulp.src(['folder/*.*', 'folder/.*']) 回答2: Just use the nodir option when you call gulp.src . This will actually test the files

gulp.src() include files but ignore all folders

有些话、适合烂在心里 提交于 2019-12-23 14:19:01
问题 There is certainly such a simple answer to this that I can't find anyone that's asked it before: What globbing pattern to include all the files in a folder but ignore ALL subfolders? gulp.src('*') includes all files and folders. I just want the files and would rather not have to exclude the folders individually. 回答1: If you want to include .dotFiles as well then try gulp.src(['folder/*.*', 'folder/.*']) 回答2: Just use the nodir option when you call gulp.src . This will actually test the files

Gulp: call an async function which provides its own callback from within a transform function

廉价感情. 提交于 2019-12-23 12:37:33
问题 I want to create a function for use in a pipe() call in Gulp that'll enable conversion of xlsx files to json. I had this working with NPM package 'excel-as-json' for gulp 3, however Gulp 4 has forced me to actually understand what it is doing ;-) Six hours in, and my incapacity of getting this to work due to a lack of js/async/streaming knowledge is punching my curiosity. Code is as follows: paths = {excel_sourcefiles: "./sourcefiles/*.xls*", excel_targetdir_local_csvjson: "./targetfiles

TinyMCE gulp configuration

纵然是瞬间 提交于 2019-12-23 11:02:29
问题 I am building a web application and I want to use TinyMCE. I am using gulp and browserify. I have downloaded TinyMCE through npm and than I have required it in my app.js file and run the gulp command but I got this error Failed to load: root/js/themes/modern/theme.js . I think this is because TinyMCE needs additional files from its folder. My question is how to configurate TinyMCE to search those files in the node_modules/tinymce folder. 回答1: The answer here depends completely on how you are

How to run some gulp task based on a conditional

怎甘沉沦 提交于 2019-12-23 10:48:00
问题 Suppose I have this in my gulpfile: gulp.task('foo', ...); gulp.task('bar', function () { if (something) { // how do I run task 'foo' here? } }); 回答1: Gulp v3 Use deprecated but still working gulp.run gulp.task('foo', ...) gulp.task('bar', function () { if (something) { gulp.run('foo') } }) Alternatively, use use any plugins that consume task names as arguments, like run-sequence for example (which you will probably need anyway for running tasks in a strict sequence). I call my tasks

How to run some gulp task based on a conditional

邮差的信 提交于 2019-12-23 10:46:15
问题 Suppose I have this in my gulpfile: gulp.task('foo', ...); gulp.task('bar', function () { if (something) { // how do I run task 'foo' here? } }); 回答1: Gulp v3 Use deprecated but still working gulp.run gulp.task('foo', ...) gulp.task('bar', function () { if (something) { gulp.run('foo') } }) Alternatively, use use any plugins that consume task names as arguments, like run-sequence for example (which you will probably need anyway for running tasks in a strict sequence). I call my tasks