🌱 [Deprecated] Extensible, reliable, modular, PWA ready starter project for Angular (2 and beyond) with statically typed build and AoT compilation
4.57k
stars
1.45k
forks
source link
Gulp slowly working on windows 10 pro (clean) #2415
Open
VasilevskyAlex opened 5 years ago
/ 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"
});
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"); });
});
// // 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?