Skip to content
Snippets Groups Projects
Commit 0307fb63 authored by PavelBegunkov's avatar PavelBegunkov
Browse files

Merge branch 'feature/gulp' into develop

parents 0a845ebe 8db7e5a2
Branches
Tags
No related merge requests found
Showing
with 147 additions and 1 deletion
~dev_rating/application/cache/ ~dev_rating/application/cache/
~dev_rating/application/logs/*/ ~dev_rating/application/logs/*/
~dev_rating/application/config/ ~dev_rating/application/config/
~dev_rating/static/*
!~dev_rating/static/img/
deploy/node_modules
nbproject/ nbproject/
*.*~ *.*~
/.project /.project
...@@ -8,4 +11,4 @@ nbproject/ ...@@ -8,4 +11,4 @@ nbproject/
~dev_rating/.idea/ ~dev_rating/.idea/
/~dev_rating/modules/unittest/vendor/ /~dev_rating/modules/unittest/vendor/
db/disciplines activity.sql db/disciplines activity.sql
~dev_rating/system/vendor ~dev_rating/system/vendor
\ No newline at end of file
File moved
File moved
File moved
File moved
File moved
all: install_gulp
@
install: install_gulp
install_gulp:
$(MAKE) build -C ./gulp
GULP_DEP := gulp gulp-rename gulp-concat-css gulp-minify-css gulp-less gulp-autoprefixer
INSTALL_PATH := ../
LOCAL_FLAGS := --save-dev --prefix $(INSTALL_PATH)
build:
npm install -g gulp
npm install $(LOCAL_FLAGS) $(GULP_DEP)
call npm install -g gulp
call npm install --save-dev --prefix ../ gulp gulp-rename gulp-concat-css gulp-minify-css gulp-less gulp-autoprefixer
npm install -g gulp
npm install --save-dev --prefix ../ gulp gulp-rename gulp-concat-css gulp-minify-css gulp-less gulp-autoprefixer
'use strict';
var fs = require('fs');
var gulp = require('gulp');
// gulp plugins
var less = require('gulp-less');
//var prefix = require('gulp-autoprefixer'); //префиксы
//var concatCss = require('gulp-concat-css'); //конкатенация
//var minifyCss = require('gulp-minify-css'); //минификация
//var rename = require('gulp-rename'); //переименовывание
// =============================
// paths
// =============================
var sysPath = {
root: '../',
app: '../~dev_rating/',
};
var srcPath = {
css: sysPath.root + 'media/css/',
less: sysPath.root + 'media/less/',
js: sysPath.root + 'media/js/',
media: sysPath.root + 'media/',
config: sysPath.root + 'config/',
};
var dstPath = {
css: sysPath.app + 'static/css/',
less: sysPath.app + 'static/css/',
js: sysPath.app + 'static/js/',
media: sysPath.app + 'static/',
config: sysPath.app + 'application/config/',
};
// =============================
// rules
// =============================
gulp.task('less:compile', function () {
gulp.src(srcPath.less + '**/*.less')
.pipe(less())
.pipe(gulp.dest(dstPath.css));
});
gulp.task('css:copy', function() {
gulp.src(srcPath.css + '**/*.css')
.pipe(gulp.dest(dstPath.css));
});
gulp.task('js:copy', function() {
gulp.src(srcPath.js + '**/*.js')
.pipe(gulp.dest(dstPath.js));
});
gulp.task('config:copy', function() {
gulp.src(srcPath.config + '*')
.pipe(gulp.dest(dstPath.config));
});
gulp.task('folders:create', function() {
var dirs = [
sysPath.app + 'application/logs/',
sysPath.app + 'application/cache/',
sysPath.app + 'application/cache/twig/'
];
fs.mkdir(dirs[0], function() {});
fs.mkdir(dirs[1], function() {
fs.mkdir(dirs[2], function() {});
});
});
// gulp.task('css', ['less'], function() {
// return gulp.src('css/*.css')
// .pipe(concatCss('styles/bundle.css'))
// .pipe(prefix('last 2 versions', '> 1%', 'ie9'))
// .pipe(minifyCss(''))
// .pipe(rename({suffix: '.min'}))
// .pipe(gulp.dest('out/'));
// });
// gulp.task('copyHtml', function() {
// gulp.src('source/*.html').pipe(gulp.dest('public'));
// });
// =============================
// watch
// =============================
gulp.task('watch', function () {
gulp.watch(srcPath.css + '*.css', ['css:copy']);
gulp.watch(srcPath.less + '*.less', ['less:compile']);
});
// =============================
// common tasks
// =============================
gulp.task('config', [
'config:copy'
]);
gulp.task('default', [
'less:compile',
'css:copy',
'js:copy',
]);
gulp.task('install', [
'folders:create',
'config',
'default'
]);
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