Questions tagged [gulp-rename]

gulp-rename is a gulp plugin to rename files easily.

gulp-rename is a gulp plugin for easy file renaming.

Rename using string example:

var rename = require("gulp-rename");

gulp.src("./app/main/text/hello-world.txt")
  .pipe(rename("main/text/ciao/goodbye-world.md"))
  .pipe(gulp.dest("./build")); // ./build/main/text/ciao/goodbye-world.md

Rename using function:

var rename = require("gulp-rename");

gulp.src("./app/main/text/hello-world.txt")
  .pipe(rename(function (path) {
    path.dirname += "/ciao";
    path.basename += "-guys";
    path.extname = ".md"
  }))
  .pipe(gulp.dest("./build")); // ./build/main/text/ciao/hello-world-guys.md
54 questions
1
vote
1 answer

How do I make a min file in the same path or dest on gulp-rename and gulp-uglify?

Hi everyone I hope you having a great day, I'm trying to find a way on how do I make a min file in the same path or gulp.dest() on gulp(gulp-uglify and gulp-rename). In my code below when I run my gulp it keeps on creating *.min.js , *.min.min.js ,…
1
vote
1 answer

Use filename from earlier gulp.src in gulp.rename() call

I have a zip-file in a folder, I want to extract one of its (zipped) files and give it a filename pattern source file basename + .xml in folder…
MattV
  • 1,353
  • 18
  • 42
1
vote
1 answer

gulp rename consider .min.js as the extension

In a gulp task, I want to include a javascript file and inserting version within the file name. Basically, in my task, I want to copy : ./node_modules/bootstrap-sass/assets/javascripts/bootstrap.js to…
Steve B
  • 36,818
  • 21
  • 101
  • 174
1
vote
1 answer

Gulp partially remove directories structure

My directories structure is similar to this: app/ directory1/ assets/ images/ js/ directory2/ assets/ images/ dist/ assets/ images/ js/ What I try to achieve using Gulp is to "gather" assets from directories…
Mike
  • 1,979
  • 2
  • 16
  • 29
1
vote
1 answer

Dynamic gulp.dest path for modular app

I'm trying to setup gulp for a modular application. In my public folder, I have modules each with their own src/sass and dist/css folders. I want to transform and transfer the sass files from src/sass to their respective dist/css folder. There could…
S. Lacroix
  • 11
  • 3
1
vote
0 answers

Using gulp-clean-css and gulp-rename to minify and rename with .min.css prefix, but gulp erases style.min.css file

So, below is my entire gulp file. I have a style.css in my styles/src folder, and I want gulp to output a style.min.css file in my styles/dist folder. gulp-clean-css makes the minified file, and gulp-rename adds the .min suffix. When I have an…
Jon Nardini
  • 59
  • 1
  • 7
1
vote
1 answer

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 distribution package index.html
Jonathan Anctil
  • 1,025
  • 3
  • 20
  • 44
1
vote
1 answer

gulp-exec : how to inject dest files in the command based on source files

I have written a gulp task to generate pdf files based on source files written in markdown format (using the gulp-exec plugin and a command line tool called Pandoc). My task looks like this: gulp.task('pandoc', function() { var options = { …
1
vote
1 answer

Gulp to compile LESS in multiple Wordpress theme folders and create respective CSS folders

I am trying to get Gulp to compile all my LESS files from a LESS folder and then create a CSS folder within their respective Wordpress theme folders compiled into a directory css/main.css file. This is using Wordpress…
dope
  • 113
  • 3
  • 11
1
vote
1 answer

How to remove the suffix using gulp rename

I wish to copy some twig files while removing the 'src' suffix example: someCode.html.src.twig with the result : someCode.html.twig using gulp rename as I must have this change implemented for several files that all have the src suffix. I also…
jjscloud
  • 41
  • 8
1
vote
1 answer

How to make gulp-rename rename a concrete single file?

I generate CSS from LESS files and want to give to all generated Bootstrap CSS files a prefix "bootsrtap", but not to the bootstrap.css. So, I set the prefix directly after the compilation, but all my attempts to do a futher rename are failing. var…
automatix
  • 14,018
  • 26
  • 105
  • 230
1
vote
1 answer

How do I rename image file names to match the folder name plus a number?

In Gulp, how do I rename image file names to match the folder name plus a number? For example, I have: img/cats/spotty.svg img/cats/edgar.svg and I'd like: images/cats/cat1.svg images/cats/cat2.svg I have several other subfolders besides cats as…
Klammertime
  • 78
  • 1
  • 8
1
vote
2 answers

Gulp rename and base path

I am searching for a solution allowing to modify the base part of path. I have a path like 'app/assets/theme/file.css' that i get with 'app/**/*.css' pattern and I would like to transform it to 'dist/assets/theme/file.css'. For now I am doing…
ChrisV
  • 233
  • 4
  • 15
1
vote
0 answers

Gulp SASS, autoprefixer, minify and sourcemaps generate huge file

I'm experiencing strange behaviour using this Gulp configuration to minify my SASS files generating sourcemaps. 'use strict'; var PATH = { SRC_DIR: 'src/', SRC: { IMG: 'img/', INDEX: 'index.html', JS: { …
1
vote
1 answer

Using gulp and gulp-rename to output multiple stylus theme files

I'm trying to set up a theme system for my project, what I have currently takes a theme file in stylus like theme\default.theme.styl that only includes variables storing colors and applies it to whatever other component style files we have included…
endlist
  • 21
  • 7