Skip to content

Commit

Permalink
add to build CSS and JS files without compression
Browse files Browse the repository at this point in the history
  • Loading branch information
itchief committed Sep 9, 2018
1 parent e5384ae commit 008303f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
7 changes: 6 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ var gulp = require('gulp'), // подключаем Gulp
imagemin = require('gulp-imagemin'), // плагин для сжатия PNG, JPEG, GIF и SVG изображений
jpegrecompress = require('imagemin-jpeg-recompress'), // плагин для сжатия jpeg
pngquant = require('imagemin-pngquant'), // плагин для сжатия png
del = require('del'); // плагин для удаления файлов и каталогов
del = require('del'), // плагин для удаления файлов и каталогов
rename = require('gulp-rename');

/* задачи */

Expand All @@ -85,6 +86,8 @@ gulp.task('css:build', function () {
.pipe(autoprefixer({ // добавим префиксы
browsers: autoprefixerList
}))
.pipe(gulp.dest(path.build.css))
.pipe(rename({suffix: '.min'}))
.pipe(cleanCSS()) // минимизируем CSS
.pipe(sourcemaps.write('./')) // записываем sourcemap
.pipe(gulp.dest(path.build.css)) // выгружаем в build
Expand All @@ -96,6 +99,8 @@ gulp.task('js:build', function () {
return gulp.src(path.src.js) // получим файл main.js
.pipe(plumber()) // для отслеживания ошибок
.pipe(rigger()) // импортируем все указанные файлы в main.js
.pipe(gulp.dest(path.build.js))
.pipe(rename({suffix: '.min'}))
.pipe(sourcemaps.init()) //инициализируем sourcemap
.pipe(uglify()) // минимизируем js
.pipe(sourcemaps.write('./')) // записываем sourcemap
Expand Down
11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,20 @@
"description": "Start project with use Bootstrap 4",
"author": "itchief.ru",
"license": "MIT",
"repository": {
"type": "git",
"url": "git://github.com/itchief/gulp-project-bootstrap-4.git"
},
"dependencies": {
"jquery": "^3.3.1",
"popper.js": "^1.14.4",
"bootstrap": "^4.1.3"
},
"devDependencies": {
"browser-sync": "^2.24.6",
"browser-sync": "^2.24.7",
"del": "^3.0.0",
"gulp": "^3.9.1",
"gulp-autoprefixer": "^5.0.0",
"gulp-autoprefixer": "^6.0.0",
"gulp-cache": "^1.0.2",
"gulp-clean-css": "^3.10.0",
"gulp-imagemin": "^4.1.0",
Expand All @@ -23,6 +27,7 @@
"gulp-sourcemaps": "^2.6.4",
"gulp-uglify": "^3.0.1",
"imagemin-jpeg-recompress": "^5.1.0",
"imagemin-pngquant": "^6.0.0"
"imagemin-pngquant": "^6.0.0",
"gulp-rename": "^1.4.0"
}
}

0 comments on commit 008303f

Please sign in to comment.