Image lazy loader
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

98 lines
2.0 KiB

11 years ago
/*
* Gruntfile.js
* @author Todd Motto
* @version 1.0.0
11 years ago
*/
'use strict';
11 years ago
var LIVERELOAD_PORT = 35729;
11 years ago
11 years ago
var lrSnippet = require('connect-livereload')({
port: LIVERELOAD_PORT
});
11 years ago
11 years ago
var mountFolder = function (connect, dir) {
return connect.static(require('path').resolve(dir));
};
11 years ago
11 years ago
module.exports = function (grunt) {
11 years ago
11 years ago
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
11 years ago
11 years ago
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
project: { name: 'echo' },
connect: {
options: {
port: 9000,
hostname: 'localhost'
},
livereload: {
options: {
middleware: function (connect) {
return [lrSnippet, mountFolder(connect, 'dist')];
}
11 years ago
}
11 years ago
}
},
tag: {
11 years ago
banner: '/*! <%= pkg.name %> v<%= pkg.version %> | (c) <%= grunt.template.today(\'yyyy\') %> @toddmotto | MIT license | github.com/toddmotto/echo */\n',
11 years ago
},
jshint: {
options: {
jshintrc: '.jshintrc'
},
files: 'src/<%= project.name %>.js',
},
concat: {
dist: {
src: ['src/<%= project.name %>.js'],
dest: 'dist/<%= project.name %>.js'
},
options: {
banner: '<%= tag.banner %>'
}
},
uglify: {
files: {
src: ['dist/<%= project.name %>.js'],
dest: 'dist/<%= project.name %>.min.js'
},
options: {
banner: '<%= tag.banner %>'
}
},
open: {
server: {
path: 'http://localhost:<%= connect.options.port %>'
}
},
watch: {
concat: {
files: 'src/{,*/}*.js',
tasks: ['concat:dist', 'uglify']
},
livereload: {
options: {
livereload: LIVERELOAD_PORT
},
files: [
'{,*/}*.html',
'dist/{,*/}*.js'
]
}
}
});
11 years ago
11 years ago
grunt.registerTask('default' , [
'jshint',
'concat:dist',
'uglify',
11 years ago
// 'connect:livereload',
// 'open',
// 'watch'
11 years ago
]);
11 years ago
11 years ago
};