Questions tagged [gulp-uglify]

gulp-uglify is a gulp plugin for files minification using UglifyJS.

gulp-uglify integrates files minification using UglifyJS into gulp workflow. It's as easy to use as:

var uglify = require('gulp-uglify');

gulp.task('make-it-ugly', function() {
  return gulp.src('app/components/*.js')
    .pipe(uglify())
    .pipe(gulp.dest('build'));
});

gulp-uglify npm package: https://www.npmjs.com/package/gulp-uglify.

251 questions
4
votes
1 answer

Concatenated and uglified Javascript file larger than source files

Hello I have the following gulpfile.js: 'use strict'; var gulp = require('gulp'), jshint = require('gulp-jshint'), sass = require('gulp-ruby-sass'), compass = require('gulp-compass'), gutil = require('gulp-util'), concat =…
user3718908x100
  • 7,939
  • 15
  • 64
  • 123
4
votes
0 answers

Gulp UglifyJs Skip Files

I am using Gulp UglifyJS and want to preserve function names for specific files. Is there a way to not mangle certain files?? Does mangle.except accept a path?
c0deNinja
  • 3,956
  • 1
  • 29
  • 45
4
votes
0 answers

UglifyJS - Remove specific functions calls

Is there a way to discard calls to specific functions calls using Uglify2? Like the option drop_console will discard calls to console.* functions. I need to discard calls to specific functions. For example: var myObj = { func1: function() {}, …
dbabaioff
  • 267
  • 2
  • 13
4
votes
1 answer

Gulp, concat and uglify files and concat with vendor

I want to concat and uglify my JS files with gulp. After that I want to conact the result with a vendor folder which includes jquery, bootstrap, ... How can I concat the files from the vendor folder after uglify my js code? Here is my current gulp…
Marvin Caspar
  • 1,319
  • 1
  • 14
  • 25
3
votes
2 answers

angular breaks after gulp-uglify and gulp-concat for controllers where I have used $uibModal

This is my gulpfile.js var gulp = require('gulp'); var uglify = require('gulp-uglify'); var concat = require('gulp-concat'); var livereload = require('gulp-livereload'); var del = require('del'); var minifyCss = require('gulp-minify-css'); var…
Rohit Dhore
  • 191
  • 3
  • 15
3
votes
0 answers

Uglify File but don't minify certain strings

Is it possible using UglifyJS2 with gulp to effectivly ignore certain strings such as: {% if VARIABLE == VARIABLE %} {% else %} {% elseif VARIABLE > VARIABLE %} {% endif %} Essentially, we are using liquid in our js as we are on the Shopify…
Matthew P
  • 717
  • 1
  • 7
  • 22
3
votes
2 answers

gulp uglification throwing error for Angular2

Some Background I am using gulp as my task runner for this angular2 application I am working on. This app also uses angular's material design libraries. I am also using Hammer.js for mobile gesture support. All this is done in VS2015 update…
user20358
  • 14,182
  • 36
  • 114
  • 186
3
votes
3 answers

gulp-include with gulp-uglify doesn't work

I have a gulp.task 'scripts' that uses gulp-uglify. Then I also added gulp-import and it didn't work. If i do only uglify it works. If I do only import it works. But if i do both at the same time it doesn't work. Here is the…
sandrina-p
  • 3,794
  • 8
  • 32
  • 60
3
votes
0 answers

Gulp generate list of source files and insert into concatenated file

Using Gulp I'm currently concatenating files from a src glob and outputting the concatenated + uglififed file elsewhere, this is working fine. I also insert a header at the top of the file to let everyone know it was generated by a Gulp script,…
evovilol
  • 51
  • 5
3
votes
1 answer

How can I uglify my bundle files for React with gulp?

I have a gulp file set up and I have properly minified all of my scripts and css files with the exception of my bundle.jsand my homeBundle.js. I have the uglify() function running in each one of my tasks, but receive the following error when I try…
jshuadvd
  • 552
  • 5
  • 16
3
votes
1 answer

gulp undefined is not a function

Here i m new to node, angular , gulp. I m using gulp to generate minify files all the stuff while i m running the gulp task it is given me the error Below is my gulpfile.js code gulp.task('dev', function(){ var builtPartialDev =…
subhash
  • 167
  • 1
  • 4
  • 15
3
votes
1 answer

Gulp configuration not working

I'm trying to run Gulp to minify CSS, JS and move all the static stuffs (template, font, img) into build folder. My project directory structure: - project |- gulpfile.js |- package.json |- src ||- font ||- img ||- js ||- sass ||- template |-…
Matteo Guarnerio
  • 720
  • 2
  • 9
  • 26
3
votes
1 answer

Gulp-uglify wrap JS

I have a gulp task that look like this: gulp.task('compressjs', function() { gulp.src('local/**/*.js') .pipe(sourcemaps.init()) // purpose compress here is only to give better error report .pipe(uglify()) …
user1995781
  • 19,085
  • 45
  • 135
  • 236
3
votes
1 answer

what is the difference between gulp-browserify and uglify.minify

What is the difference between "gulp-browserify" and "uglify.minify". Both are used to minify the files. I am trying to compress a group of JS file to a single file both serves good which is preferable.
3
votes
1 answer

Gulp - Using existing minified files and source maps in combination with non-minified files and source maps

We are using a gulp process that, like most people, compress, uglify, and concat JavaScript files to a single "app.js" file. Some of the files that we are using are distributed via bower and already come pre-minified with source maps. Ideally,…
Chris Katz
  • 31
  • 2
1 2
3
16 17