-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
executable file
·67 lines (63 loc) · 2.2 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
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
nggettext_extract: {
databio: {
files: {
'template.pot': [__dirname + '/**/*.html', __dirname + '/**/*.js']
}
}
},
nggettext_compile: {
databio: {
files: {
'translations.js': [__dirname + "/*.po"]
}
},
},
pkg: grunt.file.readJSON('package.json'),
uglify: {
bundles: {
options: {
mangle: {
reserved: ['angular', '$', 'ol', 'define', 'Api']
}
},
files: [{
expand: true,
src: ["bundle.js", "!" + __dirname + "/bundle.min.js"],
dest: 'dist',
cwd: '.',
rename: function(dst, src) {
return src.replace('.js', '.min.js');
}
}]
}
},
"jsbeautifier": {
"default": {
src: [__dirname + "/hslayers.js", __dirname + "/app.js", __dirname + "/*.js", "!" + __dirname + "/bundle.js", "!" + __dirname + "/bundle.min.js"]
},
"git-pre-commit": {
src: [__dirname + "/hslayers.js", __dirname + "/app.js", "!" + __dirname + "/bundle.js", "!" + __dirname + "/bundle.min.js"]
}
},
jsdoc: {
dist: {
src: ['components/**/*.js'],
options: {
destination: 'docs',
configure: 'node_modules/angular-jsdoc/common/conf.json',
template: 'node_modules/angular-jsdoc/angular-template',
readme: './README.md'
}
}
}
});
grunt.loadNpmTasks('grunt-jsbeautifier');
grunt.loadNpmTasks('grunt-angular-gettext');
grunt.loadNpmTasks('grunt-jsdoc');
grunt.loadNpmTasks('grunt-contrib-uglify-es');
grunt.registerTask('default', ['jsbeautifier', 'uglify']);
grunt.registerTask('git-pre-commit', ['jsbeautifier']);
};