Dimitrios Desyllas
Dimitrios Desyllas

Reputation: 10048

Gulp remove .min.* from filenames

I have the following array of files

  var jqueryFiles=[
                    'bower_components/jquery/dist/jquery.min.js',
                    'bower_components/jquery-slimscroll/jquery.slimscroll.min.js',
                    'bower_components/jquery-ui/jquery-ui.min.js'
                  ]

What I want to achieve is to move them into the folder web/assets/vendor but with their names not have the .min. before js eg.

I want to move the 'bower_components/jquery-slimscroll/jquery.slimscroll.min.js into the web/assets/vendor/jquery.slimscroll.js file

Any ideas?

Upvotes: 0

Views: 463

Answers (1)

Muhammed Neswine
Muhammed Neswine

Reputation: 2047

You could use gulp-ext-replace to do that. If in development, you can specify the code like this

var ext_replace = require('gulp-ext-replace');
 gulp.src("file.js").pipe(ext_replace('.min.js', '.js')).pipe(gulp.dest(tagrget)

Upvotes: 2

Related Questions