mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
[enh] Add --dev option to gulp tasks tp prevent time consuming compression.
This commit is contained in:
parent
3595b6c5af
commit
5df9eef1b0
3 changed files with 14 additions and 4 deletions
|
@ -28,6 +28,8 @@ bower install
|
|||
npm install -g gulp
|
||||
gulp build
|
||||
```
|
||||
Alternatively you can pas the `--dev` option to gulp which improve building
|
||||
speed by bypassing compression tasks.
|
||||
|
||||
## Dependencies
|
||||
|
||||
|
|
|
@ -11,8 +11,14 @@ var concat = require('gulp-concat'),
|
|||
cssmin = require('gulp-cssmin'),
|
||||
imagemin = require('gulp-imagemin'),
|
||||
rename = require('gulp-rename')
|
||||
util = require('gulp-util')
|
||||
gulpif = require('gulp-if')
|
||||
;
|
||||
|
||||
// Environment variables
|
||||
isDev = (util.env.dev) ? true : false;
|
||||
isProduction = !isDev;
|
||||
|
||||
// Global build task
|
||||
gulp.task('build', [
|
||||
'css',
|
||||
|
@ -46,7 +52,7 @@ gulp.task('js', function() {
|
|||
'js/yunohost/filters.js',
|
||||
'js/yunohost/controllers/*.js',
|
||||
])
|
||||
.pipe(uglify())
|
||||
.pipe(gulpif(isProduction, uglify()))
|
||||
.pipe(concat('script.min.js'))
|
||||
.pipe(gulp.dest('./dist/js'))
|
||||
});
|
||||
|
@ -85,7 +91,7 @@ gulp.task('css', function () {
|
|||
.pipe(rename({
|
||||
suffix: '.min'
|
||||
}))
|
||||
.pipe(cssmin())
|
||||
.pipe(gulpif(isProduction, cssmin()))
|
||||
.pipe(gulp.dest('./dist/css'))
|
||||
});
|
||||
|
||||
|
@ -104,6 +110,6 @@ gulp.task('css-lint', function() {
|
|||
// Images task
|
||||
gulp.task('img', function () {
|
||||
return gulp.src('img/*')
|
||||
.pipe(imagemin())
|
||||
.pipe(gulpif(isProduction, imagemin()))
|
||||
.pipe(gulp.dest('./dist/img'))
|
||||
});
|
||||
|
|
|
@ -12,16 +12,18 @@
|
|||
},
|
||||
"homepage": "https://github.com/YunoHost/yunohost-admin",
|
||||
"devDependencies": {
|
||||
"bower": "^1.7.7",
|
||||
"gulp": "^3.9.0",
|
||||
"gulp-autoprefixer": "^2.3.1",
|
||||
"gulp-concat": "^2.6.0",
|
||||
"gulp-csslint": "^0.2.0",
|
||||
"gulp-cssmin": "^0.1.7",
|
||||
"gulp-if": "^2.0.0",
|
||||
"gulp-imagemin": "^2.3.0",
|
||||
"gulp-jshint": "^1.11.2",
|
||||
"gulp-less": "^3.0.3",
|
||||
"gulp-rename": "^1.2.2",
|
||||
"gulp-uglify": "^1.2.0",
|
||||
"bower": "^1.7.7"
|
||||
"gulp-util": "^3.0.7"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue