Serious performance issues. Stucked :(
See original GitHub issueHi,
I’m experiencing serious performance issues while using gulp-useref. App is pretty simple 20 html files that contains references to a couple images (10–20 total) and few js files are attached (same set of files in every html file).
Am I doing something wrong?
task:
gulp.task('html', ['styles'], function () {
var shouldMinifyJs = function(file){
return !!(env === 'production' && $.match(file, '*.js'));
};
var shouldMinifyCss = function(file){
return !!(env === 'production' && $.match(file, '*.css'));
};
var shouldMinifyInline = function(file){
return !!(env === 'production' && $.match(file, '*.html'));
};
var assets = $.useref.assets({searchPath: '{.tmp,src}'});
return gulp.src('.tmp/**/*.html')
.pipe(assets)
// Concatenate And Minify JavaScript
.pipe($.if(shouldMinifyJs, $.uglify()))
// Concatenate And Minify Styles
// In case you are still using useref build blocks
.pipe($.if(shouldMinifyCss, $.csso()))
// Set Revision
.pipe($.if(env == 'production', $.rev()))
.pipe(assets.restore())
.pipe($.useref())
// Update revision
.pipe($.if(env == 'production', $.revReplace()))
// Minify inline JS
.pipe($.if(shouldMinifyInline, $.minifyInline()))
// Minify Any HTML
.pipe($.if(shouldMinifyInline, $.minifyHtml()))
// Put vars into html
.pipe($.preprocess({context: { env: env}}))
// Output Files
.pipe(gulp.dest('dist'))
.pipe($.size({title: 'html'}));
});
typical html file:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<!-- build:css styles/main.css -->
<link rel="stylesheet" href="/startup/flat-ui/bootstrap/css/bootstrap.css">
<link rel="stylesheet" href="/startup/flat-ui/css/flat-ui.css">
<link rel="stylesheet" href="/startup/common-files/css/icon-font.css">
<link rel="stylesheet" href="/startup/common-files/css/animations.css">
<link rel="stylesheet" href="/bower_components/animate.css/animate.css">
<link rel="stylesheet" href="/bower_components/fontawesome/css/font-awesome.css">
<link rel="stylesheet" href="/styles/cookiecuttr.css">
<link rel="stylesheet" href="/styles/main.css">
<!-- endbuild -->
<!-- build:js scripts/vendor/modernizr.js -->
<script src="/bower_components/modernizr/modernizr.js"></script>
<!-- endbuild -->
</head>
<body>
! page content goes here !
<!-- build:js scripts/vendor.js -->
<!-- bower:js -->
<script src="/bower_components/jquery/dist/jquery.js"></script>
<script src="/bower_components/jquery.cookie/jquery.cookie.js"></script>
<script src="/startup/flat-ui/js/bootstrap.min.js"></script>
<script src="/startup/common-files/js/jquery.scrollTo-1.4.3.1-min.js"></script>
<script src="/startup/common-files/js/page-transitions.js"></script>
<script src="/startup/common-files/js/easing.min.js"></script>
<script src="/startup/common-files/js/jquery.svg.js"></script>
<script src="/startup/common-files/js/jquery.svganim.js"></script>
<script src="/startup/common-files/js/jquery.parallax.min.js"></script>
<script src="/startup/common-files/js/jquery.sharrre.min.js"></script>
<script src="/startup/common-files/js/startup-kit.js"></script>
<script src="/scripts/jquery.cookiecuttr.js"></script>
<!-- endbower -->
<!-- endbuild -->
</body>
</html>
Issue Analytics
- State:
- Created 9 years ago
- Comments:10 (2 by maintainers)
Top Results From Across the Web
Avast Free Stuck on Performance Issues *Solved*
The problem is on her computer as it gets stuck on Performance Issues. One time I let it run over 25 minutes and...
Read more >internet security/performance issues scan stuck at 87% | AVG
Hi Costis, Thanks for posting your concern in community forum. I suggest you to reboot your PC and try scanning it again to...
Read more >How to Troubleshoot Slow Performance Issues | Dell US
This article provides information about how to troubleshoot and resolve slow performance issues with your Dell computer.
Read more >How to Fix Slow-Running Macs - The Mac Security Blog - Intego
You can quit that process to see if it resolves the performance issues. To do this, either quit the app, if it's something...
Read more >How to troubleshoot performance issues in Outlook
Describes how to troubleshoot performance issues in Microsoft Outlook. ... Serious problems might occur if you modify the registry incorrectly.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Guys, treat only once assets and the problem this will solve the performance issue.
For example:
You may want to add it as example of usage.
P.S. Sorry for my English.
Sorry for not responding, I’m currently using a different build system, but I will get back to you when I compare the speed.