-
Notifications
You must be signed in to change notification settings - Fork 77
/
Gruntfile.js
96 lines (92 loc) · 2.77 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
/**
* Grunt Build File
*/
module.exports = function(grunt) {
var banner = '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %> */\n';
// Project configuration.
grunt.initConfig({
pkg: require('./package.json'),
concat: {
options: {
banner: banner
},
normal: {
src: ['<banner>', 'src/inline-attachment.js', 'src/input.inline-attachment.js'],
dest: 'dist/inline-attachment.js'
},
jquery: {
src: ['<banner>', 'src/inline-attachment.js', 'src/jquery.inline-attachment.js'],
dest: 'dist/jquery.inline-attachment.js'
},
codemirror3: {
src: ['<banner>', 'src/inline-attachment.js', 'src/codemirror-3.inline-attachment.js'],
dest: 'dist/codemirror-3.inline-attachment.js'
},
codemirror4: {
src: ['<banner>', 'src/inline-attachment.js', 'src/codemirror-4.inline-attachment.js'],
dest: 'dist/codemirror-4.inline-attachment.js'
},
angularjs: {
src: ['<banner>', 'src/inline-attachment.js', 'src/input.inline-attachment.js', 'src/angularjs.inline-attachment.js'],
dest: 'dist/angularjs.inline-attachment.js'
}
},
// Lists of files to be minified with UglifyJS.
uglify: {
options: {
banner: banner
},
normal: {
src: ['<banner>', 'dist/inline-attachment.js'],
dest: 'dist/inline-attachment.min.js',
separator: ';'
},
jquery: {
src: ['<banner>', 'dist/jquery.inline-attachment.js'],
dest: 'dist/jquery.inline-attachment.min.js',
separator: ';'
},
codemirror3: {
src: ['<banner>', 'dist/codemirror-3.inline-attachment.js'],
dest: 'dist/codemirror-3.inline-attachment.min.js',
separator: ';'
},
codemirror4: {
src: ['<banner>', 'dist/codemirror-4.inline-attachment.js'],
dest: 'dist/codemirror-4.inline-attachment.min.js',
separator: ';'
},
angularjs: {
src: ['<banner>', 'dist/angularjs.inline-attachment.js'],
dest: 'dist/angularjs.inline-attachment.min.js',
separator: ';'
}
},
jshint: {
all: ['src/*.js'],
options: {
curly: true,
eqeqeq: true,
eqnull: true,
browser: true,
undef: true,
unused: true,
strict: true,
trailing: true,
indent: 2
}
},
casperjs: {
options: {
},
files: ['tests/*.js']
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-casperjs');
grunt.registerTask('qa', ['jshint']);
grunt.registerTask('default', ['qa', 'concat', 'uglify']);
};