Skip to content
This repository has been archived by the owner on Sep 15, 2018. It is now read-only.

Commit

Permalink
build optimiert
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Gabriel committed Sep 10, 2014
1 parent 3a255e7 commit e4d500b
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 56 deletions.
1 change: 1 addition & 0 deletions .couchappignore
Expand Up @@ -5,4 +5,5 @@
// ".*\\.swp$"
// ".*\\.bak$"
"node_modules$"
"gulp-tasks$"
]
3 changes: 2 additions & 1 deletion _attachments/hProjektEdit.html
Expand Up @@ -100,7 +100,8 @@ <h3 id="hpe_löschen_meldung_meldung" class="ui-title">meldung</h3>
</div>
<script charset="utf-8">
$("#hProjektEdit").on("pageshow", window.em.handleHProjektEditPageshow);
$(":jqmData(role='page')").on("pageinit", window.em.handleHProjektEditPageinit);
$("#hProjektEdit").on("pageinit", window.em.handleHProjektEditPageinit);
//$(":jqmData(role='page')").on("pageinit", window.em.handleHProjektEditPageinit);
</script>
</div>
</body>
Expand Down
69 changes: 15 additions & 54 deletions gulpfile.js
@@ -1,59 +1,20 @@
/**
* Created by alex on 09.06.2014.
*/
var gulp = require('gulp'),
autoprefixer = require('gulp-autoprefixer'),
minifycss = require('gulp-minify-css'),
uglify = require('gulp-uglify'),
concat = require('gulp-concat'),
notify = require('gulp-notify');

gulp.task('prod', ['prod_style', 'prod_src_1', 'prod_src_2']);

gulp.task('dev', ['dev_style', 'dev_src_1', 'dev_src_2']);
/*
gulp.task('prod_style', function() {
return gulp.src(['_attachments/style/jquery.mobile.css', '_attachments/style/themes/gruen.min.css', '_attachments/style/jquery.mobile.datebox.css', '_attachments/style/evab.css'])
.pipe(autoprefixer('last 2 version', 'safari 5', 'ie 9', 'opera 12.1', 'ios 6', 'android 4'))
.pipe(minifycss())
.pipe(concat('main.css'))
.pipe(gulp.dest('_attachments/style'))
.pipe(notify({message: 'prod_style task beendet'}));
});
Quelle: https://github.com/greypants/gulp-starter
gulp.task('dev_style', function() {
return gulp.src(['_attachments/style/jquery.mobile.css', '_attachments/style/themes/gruen.min.css', '_attachments/style/jquery.mobile.datebox.css', '_attachments/style/evab.css'])
.pipe(concat('main.css'))
.pipe(gulp.dest('_attachments/style'))
.pipe(notify({message: 'dev_style task beendet'}));
});
gulpfile.js
===========
Rather than manage one giant configuration file responsible
for creating multiple tasks, each task has been broken out into
its own file in gulp/tasks. Any files in that directory get
automatically required below.
gulp.task('prod_src_1', function() {
return gulp.src(['vendor/couchapp/_attachments/jquery.mobile.js', 'vendor/couchapp/_attachments/jquery.mobile.datebox.js', 'vendor/couchapp/_attachments/jquery.form.js', 'vendor/couchapp/_attachments/jquery.couch.js', 'vendor/couchapp/_attachments/evab.js'])
.pipe(concat('main.js'))
.pipe(uglify())
.pipe(gulp.dest('vendor/couchapp/_attachments'))
.pipe(notify({ message: 'prod_src_1 task beendet' }));
});

gulp.task('dev_src_1', function() {
return gulp.src(['vendor/couchapp/_attachments/jquery.mobile.js', 'vendor/couchapp/_attachments/jquery.mobile.datebox.js', 'vendor/couchapp/_attachments/jquery.form.js', 'vendor/couchapp/_attachments/jquery.couch.js', 'vendor/couchapp/_attachments/evab.js'])
.pipe(concat('main.js'))
.pipe(gulp.dest('vendor/couchapp/_attachments'))
.pipe(notify({ message: 'dev_src_1 task beendet' }));
});
To add a new task, simply add a new task file that directory.
gulp/tasks/default.js specifies the default set of tasks to run
when you run `gulp`.
*/

gulp.task('prod_src_2', function() {
return gulp.src(['vendor/couchapp/_attachments/markerclusterer.js', 'vendor/couchapp/_attachments/markerwithlabel.js', 'vendor/couchapp/_attachments/underscore.js'])
.pipe(concat('main2.js'))
.pipe(uglify())
.pipe(gulp.dest('vendor/couchapp/_attachments'))
.pipe(notify({ message: 'prod_src_2 task beendet' }));
});
var gulp = require('gulp');
var requireDir = require('require-dir');

gulp.task('dev_src_2', function() {
return gulp.src(['vendor/couchapp/_attachments/markerclusterer.js', 'vendor/couchapp/_attachments/markerwithlabel.js', 'vendor/couchapp/_attachments/underscore.js'])
.pipe(concat('main2.js'))
.pipe(gulp.dest('vendor/couchapp/_attachments'))
.pipe(notify({ message: 'dev_src_2 task beendet' }));
});
requireDir('./gulp-tasks', {recurse: true});
4 changes: 3 additions & 1 deletion package.json
Expand Up @@ -33,6 +33,8 @@
"gulp-autoprefixer": "0.0.7",
"gulp": "~3.7.0",
"gulp-uglify": "~0.3.2",
"gulp-notify": "~1.3.1"
"gulp-notify": "~1.3.1",
"browserify": "~5.11.1",
"require-dir": "~0.1.0"
}
}

0 comments on commit e4d500b

Please sign in to comment.