5

For some reason, gulp-inject recently started taking a long time (3 minutes). Previously it would take a few seconds. I'm not sure where to begin when diagnosing this issue. Here's my output:

[18:04:39] gulp-inject 1 files into index.html.
[18:04:39] gulp-inject 277 files into index.html.
[18:04:39] Finished 'inject' after 380 ms
[18:04:39] Starting 'html'...
[18:04:39] gulp-inject 1 files into index.html.
[18:07:40] 'dist/' styles/app-9bd553d2.css 284.75 kB
[18:07:40] 'dist/' styles/vendor-28fa652f.css 188.21 kB
[18:07:40] 'dist/' scripts/vendor-2308930e.js 1.93 MB
[18:07:40] 'dist/' scripts/app-efe218d1.js 368.71 kB
[18:07:40] 'dist/' index.html 769 B
[18:07:40] 'dist/' all files 2.77 MB
[18:07:40] Finished 'html' after 3.02 min

Is there a verbose option that I'm not aware of? Any help would be appreciated.

Will I AM
  • 220
  • 1
  • 9

1 Answers1

0

Probably it's not gulp-inject which is slow. It's minification of JS/CSS which is slow. If you do something like this in your gulp build file

.pipe(config.production ? $.uglify()  : $.util.noop())
.pipe(config.production ? $.csso()    : $.util.noop()
.pipe(config.production ? $.htmlmin() : $.util.noop())

(you can read how to have this config.production variable in you script here: https://knpuniversity.com/screencast/gulp/minify-only-production )

Then most likely it will dramatically speed-up your build procedure in a non-production environment.

Eugene Retunsky
  • 13,009
  • 4
  • 52
  • 55