Does the debugger command get removed after a minify

459 Views Asked by At

I hate javascript tooling.

I have this config file:

var source = require('vinyl-source-stream');
var gulp = require('gulp');
var tap = require('gulp-tap');
var gutil = require('gulp-util');
var concat = require('gulp-concat');
var csso = require('gulp-csso');
var jshint = require('gulp-jshint');
var watchify = require('watchify');
var browserify = require('browserify');
var uglify = require('gulp-uglify');
var streamify = require('gulp-streamify');

gulp.task('prod', ['assets', 'prod-css'], function() {
  return browserify('./src/main.js', {
    standalone: standalone
  }).transform('babelify',
               { presets: ["@babel/preset-env"],
                 plugins: [] })
    .bundle()
    .on('error', onError)
    .pipe(source('okeyground.min.js'))
    .pipe(streamify(uglify()))
    .pipe(gulp.dest(destination));
});

when I add a debugger; command it doesn't get produced in the minified js. Does it get removed, or how can I put it in.

1

There are 1 best solutions below

0
Richard Muñoz On

In your code set the drop_debugger property to false in the compress options:

.pipe(
  uglify({
    compress: {
      drop_debugger: false,
    },
  })
)