angularuglifyjsgulp-uglifyjscompress

How use Angular gulp uglify?


enter image description here

gulp.task("uglify", function () {
  return (
    gulp
      .src("dist/alparslan-oto/main.js")
      .pipe(rename("main.js"))
      .pipe(sourcemaps.init())
      .pipe(uglify())
      // .pipe(sourcemaps.write()) // Inline source maps.
      // For external source map file:
      //.pipe(sourcemaps.write("./maps")) // In this case: lib/maps/bundle.min.js.map
      .pipe(gulp.dest("dist/"))
  );
});

I am using gulp uglify to compress javascript files(main,runtime,polly) in Angular. This has no effect, what would you recommend to shrink these files?


Solution

  • enter image description here

    ng build --prod --aot --hashing none output

    But I solved the problem, I created the js sourcemap with uglify and the error went away

    enter image description here