NPM vs. Bower vs. Browserify vs. Gulp vs. Grunt vs. Webpack

I'm trying to summarize my knowledge about the most popular JavaScript package managers, bundlers, and task runners. Please correct me if I'm wrong: npm & bower are package managers. They just...

Passing environment-dependent variables in webpack

I'm trying to convert an angular app from gulp to webpack. in gulp I use gulp-preprocess to replace some variables in the html page (e.g. database name) depending on the NODE_ENV. What is the best...

replace with regex for gulp-replace

I am using gulp replace to replace full path name with another name by matching starting and ending strings >...

Replacing strings in Typescript file with gulp-replace

I'm attempting to insert a build version into my Angular 2 component file, using a gulp-replace task. I'm retrieving the build version from the process variable process.env.npm_package_version....

gulp-replace and gulp-hash for all js files?

I'm having some problems with the gulp project. gulpfile.js: 'use strict'; var gulp = require('gulp'), jade = require('gulp-jade'), hash =...

Gulp - Replace Text

I have a gulp task that looks like this: gulp.task('rename-package', function() { gulp.src('package.json') .pipe(gulp.dest('packaged') ; }); This task takes the...

How make gulp-replace-task replace text in html file?

I have the following text in a index.html file I want to replace with gulp-replace-task: <img src="assets/images/logo <img style="width:100px;height:100px;"...

How to use a Capture Group with gulp-replace?

gulp-replace 0.5.4 Current via gulp and rev: <link rel="stylesheet" href="assets/styles/app-3c224ff086.css"> Goal: <link rel="stylesheet"...

Gulp replace not renaming files but does replace file contents

I have the following gulp task which I want to change the filename and contents of a file replacing any matching strings with the replacement. The matching strings in the file contents get...

Replace variables with gulp

Is it good approach to replace variables with gulp-replace in src directory ? I have src and build directories. Within src I am writing es6 JS code which should be compiled and minified into build...

Use gulp-replace-task to use replace in a php file (index.php)

I'm trying to use gulp-replace-task to replace text inside the index.php file. I know this can be done inside a .html, .css and .js file, but can't seem to get it working inside a .php file. Can...

Get "file basename" in gulp-replacer-task

I'm manipulating a set of files and I am using gulp-replacer-task to replace the content of processed files with "strings" based on the basename or path of the file currently in the pipe-line. How...

gulp replace task not working

I am building an Ionic App with AngularJS and i have a gulp task that should replace data in a file. The task executes without errors but it doesnt replace the data it is meant to replace. Its...

Gulp + Webpack or JUST Webpack?

I see people using gulp with webpack. But then I read webpack can replace gulp? I'm completely confused here...can someone explain? UPDATE in the end I started with gulp. I was new to modern...

gulp-replace only replacing text in some files in a folder

I am using gulp replace to replace a string with the version number from my package.json file as follows: gulp.task('replace',...

How to include scripts located inside the node_modules folder?

I have a question concerning best practice for including node_modules into a HTML website. Imagine I have Bootstrap inside my node_modules folder. Now for the production version of the website,...

Replace block/placeholder using Gulp

I need to replace the following blocks of code while .pipe-ing dev.html to public.html using Gulp <!-- replaceStart: nameOfBlock-css --> <link href="/css/one.css" /> ...

Replace CSS url with Gulp task

I try to replace the path of a CSS file in index.html using Gulp. The problem is I have multiple projects with different theme name, and the path of the source file is different in the...

replace string to string Gulp replace

I tried this code to replace foo by bar in my test.txt var gulp = require('gulp'); var replace = require('gulp-replace-task'); gulp.task('default', function ()...

Using Gulp and Gulp Replace Name to clone a project but rename files that contain a certain word inside multiple folders

I need to use gulp to create a clone of a project and change all file types that start with a specific word to have a different word. I have tried using gulp-replace-name. Below is a simplified...

Gulp replace occurrences of reved/renamed files in javascript

My file structure looks something like this: src/js/core.js src/js/lazyloadme.js My gulp process outputs the following after using gulp-rev and...

Regex find and replace with gulp / node and use part of the find's string in the replace?

Im performing a find and replace with gulp. I need to find this string below (ANYTHING can be anything, its not a string of 'ANYTHING'): {% id_ANYTHING %} And replace it with this: {% block...

Variable value in gulp replace

I am currently working on creating a script that converts a html website into a WordPress template. I know that you can replace text and other values in files with text. But is there also a way to...

gulp-replace from template and project source and merge into single file

Alright, one for the ages. The issue is I am trying to merge the structure from multiple sources into a single one. One of my sources is from the template.html which contains the base structure...

gulp-replace creating an unwanted directory

I created this simple gulp task: gulp.task('default', function () { gulp.src(['test.txt']) .pipe(replace('aaa', 'bbb')) ...

Gulp revisioning with gulp-rev, gulp-rev-replace, gulp-rev-css-url

I am trying to re-write references to my versioned image files with gulp-rev, gulp-rev-replace and gulp-rev-css-url. I have managed to revision the files and merge the manifests with the following...

Gulp replace files with minified

I have the following tree structure |-src |--assets |---script.js and I want to replace the contents of script.js with their minified version of it WITHOUT renaming it into script-min.js. The...

Gulp task to duplicate file, then find & replace string (regex)

I'm relatively new to Gulp and looking to create a task that would clone a file, move it to a directory, then find and replace the following (keep note that the number of spaces proceeding the...

Can gulp completely replace grunt?

Recently I'm looking into gulp, I like its idea of stream and using code to build tasks. I used to use grunt for development workflow, now I want to use gulp to replace grunt. But grunt seems to...

How can the base directory be replaced with gulp?

I need to alter a stream of files to contain a different base folder name. I thought the gulp-rename plugin would allow for this, but it only seems to replace the glob...