snapshot.js
Version:
Take a snapshot of a URL
77 lines (72 loc) • 2.11 kB
JavaScript
/*jslint node: true*/
var path = require('path');
module.exports = function(grunt) {
// Project configuration.
var iframe2imagePath = require.resolve('iframe2image'),
iframe2imageDir = path.dirname(iframe2imagePath),
iframe2imageConcat = path.join(iframe2imageDir, '../dist/iframe2image.withdomvas.js');
grunt.initConfig({
pkg: '<json:package.json>',
meta: {
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'<%= pkg.homepage ? "* " + pkg.homepage + "\n" : "" %>' +
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */'
},
concat: {
dist: {
src: ['<banner:meta.banner>', '<file_strip_banner:lib/<%= pkg.name %>.js>'],
dest: 'dist/<%= pkg.name %>.js'
},
distWithDeps: {
src: ['<banner:meta.banner>', iframe2imageConcat, '<file_strip_banner:lib/<%= pkg.name %>.js>'],
dest: 'dist/<%= pkg.name %>.withDeps.js'
}
},
min: {
dist: {
src: ['<banner:meta.banner>', '<config:concat.dist.dest>'],
dest: 'dist/<%= pkg.name %>.min.js'
},
distWithDeps: {
src: ['<banner:meta.banner>', '<config:concat.distWithDeps.dest>'],
dest: 'dist/<%= pkg.name %>.withDeps.min.js'
}
},
test: {
files: ['test/**/*.js']
},
lint: {
files: ['grunt.js', 'lib/**/*.js', 'test/**/*.js']
},
watch: {
files: '<config:lint.files>',
tasks: 'lint test'
},
jshint: {
options: {
curly: true,
eqeqeq: true,
immed: true,
latedef: true,
newcap: true,
noarg: true,
sub: true,
undef: true,
boss: true,
eqnull: true,
strict: false,
browser: true
},
globals: {
exports: true,
module: false,
iframe2image: true
}
},
uglify: {}
});
// Default task.
grunt.registerTask('default', 'lint test concat min');
};