由于某些原因,吞咽注射最近开始花费很长的时间(3分钟)。以前需要几秒钟的时间。在诊断此问题时,我不确定从哪里开始。下面是我的输出:
[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有没有我不知道的详细选项?任何帮助都将不胜感激。
发布于 2016-05-01 15:15:50
可能不是gulp-inject太慢了。它是JS/CSS的缩写,速度很慢。如果您在gulp构建文件中执行类似操作
.pipe(config.production ? $.uglify() : $.util.noop())
.pipe(config.production ? $.csso() : $.util.noop()
.pipe(config.production ? $.htmlmin() : $.util.noop())(您可以在以下位置阅读如何在脚本中使用此config.production变量:https://knpuniversity.com/screencast/gulp/minify-only-production )
然后,它很可能会极大地加快您在非生产环境中的构建过程。
https://stackoverflow.com/questions/34190812
复制相似问题