mgechev / mgechev/angular-seed

Gulp slowly working on windows 10 pro (clean)

Open
#2,415 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
4.5k
Forks
1.4k
PR merge metrics
No merged PRs in 30d

Description

![screenshot_1](https://user-images.githubusercontent.com/23553481/52132898-dab05200-2648-11e9-81b7-2efe17139564.png)
"use strict";
var gulp = require("gulp"),
autoprefixer = require("gulp-autoprefixer"),
removeComments = require('gulp-strip-css-comments'),
rename = require("gulp-rename"),
sass = require("gulp-sass"),
cssnano = require("gulp-cssnano"),
rigger = require("gulp-rigger"),
uglify = require("gulp-uglify"),
watch = require("gulp-watch"),
plumber = require("gulp-plumber"),
run = require("run-sequence"),
rimraf = require("rimraf"),
sourcemaps = require('gulp-sourcemaps'),
webserver = require("browser-sync"),
csso = require('gulp-csso'),
cache = require('gulp-cached');

/* Paths to source/build/watch files
=========================*/

var path = {
build: {
// html: "build/",
// fonts: "build/fonts"
js: "build/js",
// img: "images/",
css: "build/css"
},
src: {
html: "*.{htm,html}",
js: "js/*.js",
css: "sass/style.scss"
// img: "images/**/*.*",
// fonts: "fonts/**/*.*"
},
watch: {
html: "*.{htm,html}",
js: "js/**/*.js",
css: "sass/**/*.scss"
// img: "images/**/*.*",
// fonts: "fonts/**/*.*"
},
clean: "./build"
};

/* Webserver config
=========================*/

var config = {
server: "",
notify: false,
open: true,
ui: false
};

/* Tasks
=========================*/

gulp.task("webserver", function () {
webserver(config);
});

gulp.task("html:build", function () {
return gulp.src(path.src.html)
.pipe(plumber())
.pipe(rigger())
.pipe(webserver.reload({stream: true}));
});

gulp.task("css:build", function () {
return gulp.src(path.src.css)
.pipe(plumber())
// .pipe(sourcemaps.init())
.pipe(sass())
.pipe(autoprefixer({
browsers: ["last 5 versions"]
}))
.pipe(cssnano({
zindex: false,
discardComments: {
removeAll: true
}
}))
// .pipe(sourcemaps.write(path.build.css))
// .pipe(removeComments())
.pipe(rename("style.min.css"))
// .pipe(sourcemaps.write('.'))
.pipe(gulp.dest(path.build.css))
.pipe(webserver.reload({stream: true}));
});

gulp.task("js:build", function () {
return gulp.src(path.src.js)
.pipe(plumber())
.pipe(rigger())
.pipe(gulp.dest(path.build.js))
.pipe(uglify())
// .pipe(rename("main.min.js"))
.pipe(gulp.dest(path.build.js))
.pipe(webserver.reload({stream: true}));
});

// gulp.task("fonts:build", function() {
// gulp.src(path.src.fonts)
// .pipe(gulp.dest(path.build.fonts));
// });

// gulp.task("image:build", function () {
// gulp.src(path.src.img)
// .pipe(imagemin({
// optimizationLevel: 3,
// progressive: true,
// svgoPlugins: [{removeViewBox: false}],
// interlaced: true
// }))
// .pipe(gulp.dest(path.build.img));
// });

gulp.task("clean", function (cb) {
rimraf(path.clean, cb);
});

gulp.task('build', function (cb) {
run(
"clean",
// 'sass',
"css:build",
"js:build"
// "upload"
// "html:build"
// "fonts:build"
// "image:build"

, cb);

});

gulp.task("watch", function() {
watch([path.watch.html], function(event, cb) {
gulp.start("html:build");
});
watch([path.watch.css], function(event, cb) {
gulp.start("css:build");
});
watch([path.watch.js], function(event, cb) {
gulp.start("js:build");
});

// watch([path.watch.css, path.watch.js], function(event, cb) {
// gulp.start("upload");
// });
// watch([path.watch.img], function(event, cb) {
// gulp.start("image:build");
// });
// watch([path.watch.fonts], function(event, cb) {
// gulp.start("fonts:build");
// });
});

//
// gulp.task('upload', function() {
//
//
// return gulp.src('build/**/*')
// .pipe(changed(path.build.js, path.build.css))
// .pipe(sftp({
// host: host,
// user: user,
// pass: pass,
// remotePath: remotePath
// }))
// });

gulp.task("default", function (cb) {
run(
"clean",
"build",
"watch",
// 'sass'
"webserver"
, cb);
});

Hello i`m using gulp on my windows 10 pro (clean),

i have sass structure folder (screen)

in folder Blocks i have ~20 scss files.

PC specifications:
Intel core I5 2500k (4cpu) ~3.6Ghz
Ram: 8gb ddr3 1333Mhz
video: gigabyte 1050ti 4gb

at my job i have
Intel i3
~ 4gb ddr3
intel Hd graphics video,

BUT!!! ( ubunut 18 version)
and here gulp working normal

gulp compile first 5 minutes ~200ms (its ok)
after 5 minutes, compile ~5-50s

a year ago i dont have this problem, all were good

gulp ver 3.9.1
node ver 10.10.0
nmp ver 6.4.1

sorry for my English :)
![gulp](https://user-images.githubusercontent.com/23553481/52110727-31e30200-260a-11e9-9ad1-0ed66c23229d.png)

Does anyone know what the problem?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Use the provided Gulp task configuration as the entry point, especially the default, build, watch, css:build, and js:build tasks. Run the default or build workflow on Windows, compare timings across the listed tasks, and inspect the Sass and JavaScript pipelines for the slowdown. Done means the cause is reproducible and the affected workflow completes without the reported delay.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js, sass
Domain
build-system, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.