This repository was archived by the owner on Oct 24, 2022. It is now read-only.
Repository navigation
Expand file tree
/
Copy pathGruntfile.js
More file actions
95 lines (93 loc) · 2.9 KB
/
Copy pathGruntfile.js
File metadata and controls
95 lines (93 loc) · 2.9 KB
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
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
clean: {
rebuild: ['dist/*']
},
concat: {
options: {
banner: '(function() {\n',
footer: '})();'
},
js: {
src: [
'src/js/Bootstrap.js',
'src/js/Xhr.js',
'src/js/Utils.js',
'src/js/Geocoder.js'
],
dest: 'dist/W3W.Geocoder.js'
}
},
jshint: {
options: {
jshintrc: true
},
beforeconcat: ['src/js/**/*.js', 'test/js/**/*.js'],
afterconcat: ['dist/W3W.Geocoder.js'],
grunt: ['Gruntfile.js']
},
uglify: {
js: {
files: {
'dist/W3W.Geocoder.min.js': ['dist/W3W.Geocoder.js']
}
}
},
jasmine: {
js: {
src: 'dist/W3W.Geocoder.js',
options: {
specs: 'test/js/**/*.spec.js',
vendor: ['node_modules/jasmine-expect/dist/jasmine-matchers.js'],
template: 'test/js/templates/SpecRunner.tmpl',
templateOptions: {
api_key: process.env.W3W_API_KEY
},
'--web-security' : false,
'--local-to-remote-url-access' : true,
'--ignore-ssl-errors' : true
}
}
},
version: {
project: {
src: ['bower.json', 'src/js/Bootstrap.js', 'package.json']
}
},
watch: {
options: {
livereload: true,
},
grunt: {
files: ['Gruntfile.js'],
tasks: ['jshint:grunt', 'build'],
},
js: {
files: ['src/js/**/*.js'],
tasks: ['jshint', 'concat']
},
uglify: {
files: ['dist/*.js', '!dist/*.min.js'],
tasks: ['uglify']
},
test: {
files: ['dist/*.js', '!dist/*.min.js', 'test/js/**/*.tmpl', 'test/js/specs/**/*.js'],
tasks: ['jshint', 'test']
}
}
});
grunt.registerTask('default', ['watch']);
grunt.registerTask('nodsstore', function() {
grunt.file.expand({
filter: 'isFile',
cwd: '.'
}, ['**/.DS_Store']).forEach(function(file) {
grunt.file.delete(file);
});
});
grunt.registerTask('test', ['build', 'jasmine']);
grunt.registerTask('build', ['nodsstore', 'jshint', 'concat', 'uglify']);
grunt.registerTask('rebuild', ['clean', 'build', 'test']);
};