Commit d627a66a authored by Tobias Reich's avatar Tobias Reich
Browse files

From Grunt to Gulp

parent ae493bd9
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
module.exports = (grunt) ->
grunt.initConfig
pkg: grunt.file.readJSON 'package.json'
concat:
view:
options:
separator: "\n"
src: [
'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'
]
dest: '../assets/min/view.js'
js:
options:
separator: "\n"
src: [
'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'
]
dest: '../assets/min/main.js'
css:
options:
separator: "\n"
src: [
'../assets/css/*.css'
]
dest: '../assets/min/main.css'
uglify:
view:
options:
banner: '/*! <%= pkg.name %> <%= pkg.version %> */\n'
files:
'../assets/min/view.js': '../assets/min/view.js'
assets:
options:
banner: '/*! <%= pkg.name %> <%= pkg.version %> */\n'
files:
'../assets/min/main.js': '../assets/min/main.js'
cssmin:
assets:
options:
banner: '/*! <%= pkg.name %> <%= pkg.version %> */'
files:
'../assets/min/main.css': '../assets/min/main.css'
watch:
js:
files: [
'../assets/js/*.js'
]
tasks: ['js']
options:
spawn: false
interrupt: true
css:
files: [
'../assets/css/*.css'
]
tasks: ['css']
options:
spawn: false
interrupt: true
require('load-grunt-tasks')(grunt)
grunt.registerTask 'default', ->
grunt.task.run [
'view'
'js'
'css'
]
grunt.registerTask 'view', [
'concat:view'
'uglify:view'
]
grunt.registerTask 'js', [
'concat:js'
'uglify:assets'
]
grunt.registerTask 'css', [
'concat:css'
'cssmin:assets'
]
\ No newline at end of file
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: [
'../assets/css/*.css'
]
}
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)
.pipe(plugins.concat('main.css', {newLine: "\n"}))
.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']);
});
\ No newline at end of file
......@@ -9,14 +9,10 @@
"url": "https://github.com/electerious/Lychee.git"
},
"devDependencies": {
"grunt": "~0.4.2",
"grunt-contrib-clean": "~0.5.0",
"grunt-contrib-coffee": "~0.10.1",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-cssmin": "~0.9.0",
"grunt-contrib-uglify": "~0.4.0",
"grunt-contrib-watch": "~0.6.0",
"grunt-notify": "^0.3.0",
"load-grunt-tasks": "~0.4.0"
"gulp": "^3.6.2",
"gulp-concat": "^2.2.0",
"gulp-load-plugins": "^0.5.0",
"gulp-minify-css": "^0.3.4",
"gulp-uglify": "^0.2.1"
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment