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
7
votes
2 answers

Gulp Uglify Producing Strange Characters from Paper.js Library

I'm using the Bower package of Paper.js in a project. I'm using Gulp for preparing the project for the browser. There are some characters, however, that look like this in…
Scotty H
  • 6,432
  • 6
  • 41
  • 94
7
votes
1 answer

Gulp bundle then minify

I'm creating 3 minified bundles for my application. I have 2 tasks to do this, minify, and bundle. Minify has a dependency on bundle. If I run minify, both tasks run with no errors. The bundles are created, but the minified files are not. If I…
Ryan Langton
  • 6,294
  • 15
  • 53
  • 103
7
votes
1 answer

Uglify Minify and generate source map with Gulp

Can someone explain how to uglify, then concat and finally generate a source map using gulp? I cannot seem to get it working. I am not seeing anything in the API's about this but seems to me that it should be supported. The point is to generate the…
Subtubes
  • 15,851
  • 22
  • 70
  • 105
6
votes
0 answers

Any Node.js Minifier supports Javascript Null-Coalescing operator (??)?

I am trying to minify javascript code, which contains many instances of the null-coalescing operator (??), however they all seem to throw Unexpected token: operator (?) error when parsing lines containing the ?? operator. Is there any updated…
edrakali
  • 155
  • 1
  • 5
6
votes
2 answers

Gulp Uglify Options not applying

Hi I am making a theme for the company i work at and the JS segments will not build properly in uglify. I am trying to use uglify to simply concatenate my files, which works but they output minified and mangled with no comments and i cannot figure…
Kieranmv95
  • 828
  • 4
  • 14
  • 31
6
votes
1 answer

A lot of warnings with webpack uglify

When I'm running webpack uglify plugin and I'm getting a lot of warnings from the stylus loader / css-loader. How can I resolve them? The webpack bundles it successfully. Condition always true…
Diogo Barroso
  • 915
  • 3
  • 9
  • 22
6
votes
1 answer

How can I get current configuration (Debug/Release) of VS15 in gulpfile.js?

I've wrote a task to minify my .js files. Now, I want to conditionally uglify them (do it if in release, don't if in debug), based on the configuration mode of VS15, e.g. . Is there any variable which is accessible from the gruntfile?
user265732
  • 585
  • 4
  • 14
6
votes
2 answers

how to debug gulp-sourcemaps not doing anything?

I have a fairly standard use case for gulp-sourcemaps https://github.com/floridoo/gulp-sourcemaps gulp.src( bundle.src) .pipe(sourcemaps.init()) .pipe(concat(bundle.dst + '.' + opts.ext)) .pipe(uglify()) …
kevzettler
  • 4,783
  • 15
  • 58
  • 103
5
votes
2 answers

Gulp - Minify JS and write to same destination

I am currently refactoring a project where previously all of the minified JavaScript files were being placed in a specific directory. Now I need to the minified versions to stay in the same directories as their source files. Currently I do…
JPollock
  • 3,218
  • 4
  • 26
  • 36
5
votes
2 answers

Gulp uglify fails with js parse error

I'm strugling over a very annoying error. First at all: I'm new to gulp. I try to realise a single page application with Angular. To make my workflow better, I tried to implement gulp. I was heading some serious npm errors while installing some…
Ore
  • 972
  • 2
  • 12
  • 24
5
votes
1 answer

Debugging variables not working with gulp sourcemaps + uglify

I have the following gulp task for bundling javascript: gulp.task('js', function () { return gulp.src(paths.js) .pipe(sourcemaps.init()) .pipe(uglify()) .pipe(concat('bundle.min.js')) …
5
votes
2 answers

How can I generate valid Source Maps with Gulp, Uglify & Concat?

Has anyone found a working combination of Gulp, Uglify and Concat that generates a valid source map? There appears to be lots of issues in GitHub regarding these sorts of interactions, but equally people appear to have found combinations that work…
James Crowley
  • 3,911
  • 5
  • 36
  • 65
4
votes
0 answers

Gulp re-processes unchanged files

I'm experiencing long (~30s) rebuilds of several of my gulp tasks. I'm first transpiling using babel, then uglifying and finally concatenating the respective files. I determined that most of the time is spent on uglifying -- so I'm skipping the…
Joe - GMapsBook.com
  • 15,787
  • 4
  • 23
  • 68
4
votes
1 answer

Creating .js, .min.js and .js.map file with gulp?

I am trying to utilize gulp 3.9 to minify my resource files. I created a two different tasks in my gulpfile that looks like this var gulp = require("gulp"), concat = require("gulp-concat"), cssmin = require("gulp-cssmin"), filter =…
Junior
  • 11,602
  • 27
  • 106
  • 212
4
votes
1 answer

How to pipe input to uglify-js-harmony in gulp

I want to uglify some JS containing classes. This is not supported by gulp-uglify at the moment as discussed here. I have done . . npm install uglify-js-harmony --save-dev as advised in the previous answer, but being new to front end dev in…
learnvst
  • 15,455
  • 16
  • 74
  • 121
1
2
3
16 17