-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
66 lines (60 loc) · 2.05 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
/*global module:false*/
module.exports = function (grunt) {
var CRLF = grunt.util.linefeed;
var wrapStart = '(function() {' + CRLF;
var wrapEnd = 'require("./lib/navigator.js");' + CRLF + '}());';
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
clean: ['dist/'],
jshint: {
options: grunt.file.readJSON('.jshintrc'),
src: ['**/*.js', '!**/dist/**', '!**/node_modules/**']
},
requirejs: {
build: {
options: {
include: ['./lib/navigator.js'],
mainConfigFile: './main.js',
name: './node_modules/almond/almond.js',
optimize: 'none',
out: './dist/pinguela-client-dev.js',
useStrict: true,
wrap: {
start: wrapStart,
end: wrapEnd
}
}
},
build_min: {
options: {
include: ['./lib/navigator.js'],
mainConfigFile: './main.js',
name: './node_modules/almond/almond.js',
optimize: 'uglify2',
out: './dist/pinguela-client.js',
useStrict: true,
wrap: {
start: wrapStart,
end: wrapEnd
}
}
}
},
watch: {
lib: {
files: ['./*.js', './lib/**/*.js'],
tasks: ['build'],
options: {
debounceDelay: 1000
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-requirejs');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('test', ['jshint']);
grunt.registerTask('build', ['test', 'clean', 'requirejs']);
grunt.registerTask('default', ['build']);
};