mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
gulpfile
This commit is contained in:
parent
d6edff24d3
commit
61c807c95f
1
.gitignore
vendored
1
.gitignore
vendored
@ -5,7 +5,6 @@ tmp/
|
||||
vendor/
|
||||
composer.lock
|
||||
websrc/node_modules/
|
||||
websrc/gulpfile.js
|
||||
websrc/package-lock.json
|
||||
mithril_client/
|
||||
websrc/src/less-files.css
|
||||
|
||||
58
websrc/gulpfile.js
Normal file
58
websrc/gulpfile.js
Normal file
@ -0,0 +1,58 @@
|
||||
var gulp = require('gulp');
|
||||
var less = require('gulp-less');
|
||||
var concat = require('gulp-concat');
|
||||
var merge = require('merge-stream');
|
||||
var watch = require('gulp-watch');
|
||||
//var minify = require('gulp-minify');
|
||||
var cleanCSS = require('gulp-clean-css');
|
||||
|
||||
var bundleStyles = function() {
|
||||
|
||||
var lessStream = gulp.src('src/less/*.less')
|
||||
.pipe(concat('src/less-files.less'))
|
||||
.pipe(less())
|
||||
.pipe(gulp.dest('./'))
|
||||
;
|
||||
|
||||
var mergedStream = merge(lessStream)
|
||||
.pipe(concat('grd_styles.css'))
|
||||
//.pipe(minify())
|
||||
.pipe(gulp.dest('../webroot/css/'));
|
||||
|
||||
return mergedStream;
|
||||
};
|
||||
|
||||
var compressStyles = function() {
|
||||
var lessStream = gulp.src('src/less/*.less')
|
||||
.pipe(concat('src/less-files.less'))
|
||||
.pipe(less())
|
||||
.pipe(gulp.dest('./'))
|
||||
;
|
||||
|
||||
var mergedStream = merge(lessStream)
|
||||
.pipe(concat('grd_styles.min.css'))
|
||||
.pipe(cleanCSS({
|
||||
compatibility: 'ie8',
|
||||
level: {
|
||||
1: {
|
||||
all: true
|
||||
},
|
||||
2: {
|
||||
all: true
|
||||
}
|
||||
}
|
||||
}))
|
||||
.pipe(gulp.dest('../webroot/css/'));
|
||||
|
||||
return mergedStream;
|
||||
};
|
||||
|
||||
gulp.task("bundleStyles", bundleStyles);
|
||||
gulp.task("compressStyles", compressStyles);
|
||||
|
||||
gulp.task('watchStyles', function() {
|
||||
bundleStyles();
|
||||
watch("src/less/*.less", function() {
|
||||
bundleStyles();
|
||||
});
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user