-
Notifications
You must be signed in to change notification settings - Fork 1k
/
Gruntfile.js
73 lines (65 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
module.exports = function (grunt) {
'use strict';
grunt.initConfig({
concat: {
copy : {
src: ['bootbox.js'],
dest: 'dist/bootbox.js'
},
locales: {
src: ['templates/umd-header-locales.txt', 'locales/**/*.js', 'templates/umd-footer.txt'],
dest: 'dist/bootbox.locales.js'
},
all : {
src: ['bootbox.js', 'dist/bootbox.locales.js'],
dest: 'dist/bootbox.all.js'
}
},
jsbeautifier : {
src : ['dist/bootbox.locales.js','dist/bootbox.all.js'],
options:{
js: {
indentSize: 2
}
}
},
uglify: {
options: {
compress: true,
mangle: true,
banner: grunt.file.read('header.txt'),
output:{
quote_style: 3
}
},
my_target: {
files: {
'dist/bootbox.min.js': ['dist/bootbox.js'],
'dist/bootbox.locales.min.js': ['dist/bootbox.locales.js'],
'dist/bootbox.all.min.js': ['dist/bootbox.all.js']
}
}
},
jshint: {
options: {
jshintrc: '.jshintrc',
force: true
},
all: ['dist/bootbox.js', 'dist/bootbox.locales.js']
},
karma: {
current: {
configFile: 'karma.conf.js'
},
legacy: {
configFile: 'karma.conf.legacy.js'
}
},
});
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks("grunt-jsbeautifier");
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-karma');
grunt.registerTask('default', ['concat', 'jsbeautifier', 'uglify', 'jshint', 'karma']);
};