forked from kentcdodds/genie
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
84 lines (72 loc) · 2.02 KB
/
Gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
'use strict';
var path = require('path');
module.exports = function (grunt) {
require('time-grunt')(grunt);
var bowerInfo = grunt.file.readJSON('bower.json');
var unimplementedLamps = ['!*/dojo/**/*', '!*/ember/**/*', '!*/react/**/*', '!*/vanilla/**/*'];
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
mocha: {
all: {
src: ['tests/testrunner.html']
},
options: {
run: true
}
},
copy: {
dist: {
files: [
{
expand: true,
cwd: 'src/',
src: ['**/*.js', '!**/*Spec.js'].concat(unimplementedLamps),
dest: 'dist/'
}
]
}
},
uglify: {
options: {
banner: [
'/** ',
bowerInfo.name + ' - v' + bowerInfo.version + ' @license',
'(c) <%= grunt.template.today("yyyy-mm-dd") %> - ' + bowerInfo.authors.join('| '),
bowerInfo.description,
'Freely distributed under the ' + bowerInfo.license + ' license',
bowerInfo.homepage
].join('\n * ') + '\n */\n'
},
all: {
files: {
'dist/genie.min.js': ['src/genie.js']
}
}
},
bumpup: ['package.json', 'bower.json'],
watch: {
files: ['src/**/*', 'tests/**/*', 'Gruntfile.js'],
tasks: ['mocha', 'jshint']
},
jshint: {
src: ['src/**/*.js']
},
'gh-pages': {
options: {
base: 'demo'
},
src: ['**']
}
});
grunt.loadNpmTasks('grunt-mocha');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-bumpup');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-gh-pages');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.registerTask('buildNoUgly', ['jshint', 'mocha', 'copy:dist']);
grunt.registerTask('deploy', ['buildNoUgly', 'gh-pages']);
grunt.registerTask('build', ['buildNoUgly', 'uglify']);
grunt.registerTask('default', ['build']);
};