-
Notifications
You must be signed in to change notification settings - Fork 1k
/
Gruntfile.js
110 lines (106 loc) · 2.63 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
module.exports = function(grunt) {
'use strict';
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
all: [
'Gruntfile.js',
'src/annyang.js',
'test/spec/*Spec.js'
],
options: {
jshintrc: true
}
},
'babel': {
options: {
sourceMap: true,
presets: ['env']
},
dist: {
files: {
'dist/annyang.js': 'src/annyang.js'
}
}
},
watch: {
files: ['src/*.js', 'demo/css/*.css', 'test/spec/*Spec.js', '!**/node_modules/**'],
tasks: ['default']
},
uglify: {
options: {
output: {
comments: /^\! /
}
},
all: {
files: {
'dist/annyang.min.js': ['dist/annyang.js']
}
}
},
imagemin: {
demoimages: { // Target
options: { // Target options
},
files: [{
expand: true, // Enable dynamic expansion
cwd: 'demo/images', // Src matches are relative to this path
src: ['*.{png,jpg,gif}'], // Actual patterns to match
dest: 'demo/images' // Destination path prefix
}]
}
},
cssmin: {
combine: {
files: {
'demo/css/main.min.css': ['demo/css/main.css', 'demo/vendor/css/default.css', 'demo/vendor/css/github.css']
}
}
},
markdox: {
target: {
files: [
{src: 'src/annyang.js', dest: 'docs/README.md'}
]
}
},
connect: {
server: {
options: {
protocol: 'https',
port: 8443,
hostname: '*',
base: '.',
open: 'https://localhost:8443/demo'
}
}
},
jasmine: {
browserAMD: {
src: ['dist/annyang.min.js'],
options: {
specs: 'test/spec/*Spec.js',
outfile: 'test/SpecRunner.html',
vendor: ['test/vendor/corti.js', 'test/init_corti.js'],
keepRunner: true,
template: require('grunt-template-jasmine-requirejs'),
templateOptions: {
requireConfig: {
baseUrl: '../dist/'
}
}
}
}
}
});
// Load NPM tasks
require('load-grunt-tasks')(grunt, {
pattern: ['grunt-*', '!grunt-template-jasmine-istanbul']
});
// Register tasks
grunt.registerTask('default', ['jshint', 'babel', 'uglify', 'cssmin', 'markdox']);
grunt.registerTask('dev', ['default', 'connect', 'watch']);
grunt.registerTask('test', ['default', 'jasmine']);
};