2014-07-18 20:09:15 +00:00
|
|
|
var gulp = require('gulp'),
|
|
|
|
plugins = require("gulp-load-plugins")();
|
|
|
|
|
|
|
|
paths = {
|
|
|
|
view: [
|
|
|
|
'bower_components/jQuery/dist/jquery.min.js',
|
|
|
|
'bower_components/js-md5/js/md5.min.js',
|
|
|
|
'bower_components/mousetrap/mousetrap.min.js',
|
|
|
|
'bower_components/mousetrap/plugins/global-bind/mousetrap-global-bind.min.js',
|
|
|
|
'../assets/js/_frameworks.js',
|
|
|
|
'../assets/js/build.js',
|
|
|
|
'../assets/js/view/main.js'
|
|
|
|
],
|
|
|
|
js: [
|
|
|
|
'bower_components/jQuery/dist/jquery.min.js',
|
|
|
|
'bower_components/js-md5/js/md5.min.js',
|
|
|
|
'bower_components/mousetrap/mousetrap.min.js',
|
|
|
|
'bower_components/mousetrap/plugins/global-bind/mousetrap-global-bind.min.js',
|
|
|
|
'../assets/js/*.js'
|
|
|
|
],
|
|
|
|
css: [
|
2014-08-26 14:54:07 +00:00
|
|
|
'../assets/scss/main.scss'
|
2014-07-18 20:09:15 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
gulp.task('view', function () {
|
|
|
|
|
|
|
|
gulp.src(paths.view)
|
|
|
|
.pipe(plugins.concat('view.js', {newLine: "\n"}))
|
|
|
|
.pipe(plugins.uglify())
|
|
|
|
.pipe(gulp.dest('../assets/min/'));
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
gulp.task('js', function () {
|
|
|
|
|
|
|
|
gulp.src(paths.js)
|
|
|
|
.pipe(plugins.concat('main.js', {newLine: "\n"}))
|
|
|
|
.pipe(plugins.uglify())
|
|
|
|
.pipe(gulp.dest('../assets/min/'));
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
gulp.task('css', function () {
|
|
|
|
|
|
|
|
gulp.src(paths.css)
|
2014-08-26 14:47:12 +00:00
|
|
|
.pipe(plugins.sass())
|
2014-07-18 20:09:15 +00:00
|
|
|
.pipe(plugins.concat('main.css', {newLine: "\n"}))
|
2014-07-18 21:01:19 +00:00
|
|
|
.pipe(plugins.autoprefixer('last 4 versions', '> 5%'))
|
2014-07-18 20:09:15 +00:00
|
|
|
.pipe(plugins.minifyCss())
|
|
|
|
.pipe(gulp.dest('../assets/min/'));
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
gulp.task('default', ['view', 'js', 'css']);
|
|
|
|
|
|
|
|
gulp.task('watch', ['default'], function() {
|
|
|
|
gulp.watch(paths.view, ['view']);
|
|
|
|
gulp.watch(paths.js, ['js']);
|
|
|
|
gulp.watch(paths.css, ['css']);
|
|
|
|
});
|