Skip to content
This repository has been archived by the owner on Nov 24, 2021. It is now read-only.

Commit

Permalink
started to gulpfile
Browse files Browse the repository at this point in the history
  • Loading branch information
btk committed Jul 28, 2016
1 parent 893e866 commit 1254cc8
Show file tree
Hide file tree
Showing 11 changed files with 96 additions and 231 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -23,7 +23,7 @@ coverage
# node-waf configuration
.lock-wscript

build
dist

# Dependency directories
node_modules
Expand Down
Binary file added build/img/grid.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions build/img/potatoes.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
69 changes: 69 additions & 0 deletions gulpfile.js
@@ -0,0 +1,69 @@
var http = require('http');
var gulp = require('gulp');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var imagemin = require('gulp-imagemin');
var sourcemaps = require('gulp-sourcemaps');
var refresh = require('gulp-livereload');
var del = require('del');
var connect = require('gulp-connect');
var useref = require('gulp-useref');

var paths = {
scripts: 'js/**.js',
images: ['img/**', 'symbols/**']
};

gulp.task('useref', function(){
return gulp.src('*.html')
.pipe(useref())
.pipe(gulp.dest('dist'))
});

gulp.task('clean', function() {
// You can use multiple globbing patterns as you would with `gulp.src`
return del(['build']);
});

gulp.task('scripts', ['clean'], function() {
// Minify and copy all JavaScript (except vendor scripts)
// with sourcemaps all the way down
return gulp.src(paths.scripts)
.pipe(sourcemaps.init())
.pipe(uglify())
.pipe(concat('all.min.js'))
.pipe(sourcemaps.write())
.pipe(gulp.dest('build/js'));
});

// Copy all static images
gulp.task('images', ['clean'], function() {
return gulp.src(paths.images)
// Pass in options to the task
.pipe(imagemin({optimizationLevel: 5}))
.pipe(gulp.dest('build/img'));
});

gulp.task('html', function () {
gulp.src('*.html')
.pipe(connect.reload());
});

// Rerun the task when a file changes
gulp.task('watch', function() {
gulp.watch(paths.scripts, ['scripts']);
gulp.watch(paths.images, ['images']);
gulp.watch(['*.html'], ['html']);
});

gulp.task('connect', function() {
connect.server({
livereload: true,
port: 8894
});
});


// The default task (called when you run `gulp` from cli)
gulp.task('default', ['watch', 'scripts', 'images', 'connect', 'useref']);
//gulp.task('build', [ 'scripts', 'images', 'useref',"jsmin"]);
2 changes: 2 additions & 0 deletions index.html
Expand Up @@ -9,9 +9,11 @@
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<script src="node_modules/otsimo/otsimo.js"></script>
<!--build:js js/main.min.js -->
<script src="js/fastclick.js"></script>
<script src="js/angular.min.js"></script>
<script src="js/ngTouch.js"></script>
<!-- endbuild -->
<script src='//vws.responsivevoice.com/v/e?key=utvgu25X'></script>
<script type="text/javascript">
if ('addEventListener' in document) {
Expand Down
228 changes: 0 additions & 228 deletions json

This file was deleted.

25 changes: 23 additions & 2 deletions package.json
Expand Up @@ -13,13 +13,34 @@
"otsimo",
"aac"
],
"author": "",
"author": "burak",
"license": "ISC",
"bugs": {
"url": "https://github.com/otsimo/acc/issues"
},
"homepage": "https://github.com/otsimo/acc/#readme",
"dependencies": {
"angular": "^1.5.8",
"angular-touch": "^1.5.8",
"fastclick": "^1.0.6",
"otsimo": "^1.2.0"
}
},
"directories": {
"doc": "docs"
},
"devDependencies": {
"del": "^2.2.1",
"ecstatic": "^1.4.1",
"gulp": "^3.9.1",
"gulp-concat": "^2.6.0",
"gulp-connect": "^4.2.0",
"gulp-imagemin": "^3.0.2",
"gulp-livereload": "^3.8.1",
"gulp-sourcemaps": "^1.6.0",
"gulp-uglify": "^1.5.4",
"gulp-useref": "^3.1.0",
"http": "0.0.0",
"tiny-lr": "^0.2.1"
},
"main": "gulpfile.js"
}

0 comments on commit 1254cc8

Please sign in to comment.