Commit 05b461bf authored by Nikolay Gromov's avatar Nikolay Gromov

Добавил вывод размера скомпилированного CSS

parent 2acf361c
...@@ -31,6 +31,7 @@ const concat = require('gulp-concat'); ...@@ -31,6 +31,7 @@ const concat = require('gulp-concat');
const browserSync = require('browser-sync').create(); const browserSync = require('browser-sync').create();
const replace = require('gulp-replace'); const replace = require('gulp-replace');
const ghPages = require('gulp-gh-pages'); const ghPages = require('gulp-gh-pages');
const size = require('gulp-size');
const fs = require('fs'); const fs = require('fs');
// Запуск `NODE_ENV=production npm start [задача]` приведет к сборке без sourcemaps // Запуск `NODE_ENV=production npm start [задача]` приведет к сборке без sourcemaps
...@@ -79,6 +80,11 @@ gulp.task('less', function () { ...@@ -79,6 +80,11 @@ gulp.task('less', function () {
.pipe(rename('style.min.css')) .pipe(rename('style.min.css'))
.pipe(debug({title: "RENAME:"})) .pipe(debug({title: "RENAME:"}))
.pipe(gulpIf(isDev, sourcemaps.write())) .pipe(gulpIf(isDev, sourcemaps.write()))
.pipe(size({
title: 'Размер',
showFiles: true,
showTotal: false,
}))
.pipe(gulp.dest(dirs.build + '/css')) .pipe(gulp.dest(dirs.build + '/css'))
.pipe(browserSync.stream()); .pipe(browserSync.stream());
}); });
......
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
"devDependencies": { "devDependencies": {
"autoprefixer": "^6.3.3", "autoprefixer": "^6.3.3",
"browser-sync": "^2.11.1", "browser-sync": "^2.11.1",
"css-mqpacker": "^4.0.0",
"cross-env": "^1.0.7", "cross-env": "^1.0.7",
"css-mqpacker": "^4.0.0",
"del": "^2.2.0", "del": "^2.2.0",
"gulp": "github:gulpjs/gulp#4.0", "gulp": "github:gulpjs/gulp#4.0",
"gulp-cheerio": "^0.6.2", "gulp-cheerio": "^0.6.2",
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
"gulp-postcss": "^6.1.0", "gulp-postcss": "^6.1.0",
"gulp-rename": "^1.2.2", "gulp-rename": "^1.2.2",
"gulp-replace": "^0.5.4", "gulp-replace": "^0.5.4",
"gulp-size": "^2.1.0",
"gulp-sourcemaps": "^1.6.0", "gulp-sourcemaps": "^1.6.0",
"gulp-svgmin": "^1.2.1", "gulp-svgmin": "^1.2.1",
"gulp-svgstore": "^5.0.5", "gulp-svgstore": "^5.0.5",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment