forked from Gisto/Gisto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
89 lines (86 loc) · 2.61 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
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
'jshint': {
all: [
'app/js/app.js',
'app/js/services.js',
'app/js/controllers.js',
'app/js/filters.js',
'app/js/directives.js'
],
options: {
"curly": true,
"eqnull": true,
"eqeqeq": true,
"undef": true,
"browser": true,
"node": true,
"devel": true,
"strict": true,
"globals": {
"jQuery": true,
"$": true,
"angular": true,
"ace": true,
"Showdown": true,
"clipboard": true
}
}
},
concat_sourcemap: {
default_options: {
options: {
sourcesContent: true
},
files: {
'app/js/gisto.min.js': [
'app/lib/jquery/*.js',
'app/lib/angular/*.js',
'app/lib/socket-io/*.js',
'app/lib/angular-ui/*.js',
'app/js/*/*.js',
'app/js/app.js',
'app/lib/showdown.js'
]
}
}
},
watch: {
scripts: {
files: '**/*.js',
tasks: ['concat_sourcemap'],
options: {
interrupt: true
}
}
},
// Can be ran as `grunt --env=dev` or ``grunt --env=prod``
dev_prod_switch: {
options: {
environment: grunt.option('env') || 'dev' // 'prod' or 'dev'
},
all: {
files: {
'app/index.html': 'app/index.html' // source: destination
}
}
},
removelogging: {
dist: {
src: 'app/js/<%= pkg.name %>.min.js',
dest: 'app/js/<%= pkg.name %>.min.js'
}
}
});
grunt.loadNpmTasks('grunt-concat-sourcemap');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-dev-prod-switch');
//grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks("grunt-remove-logging");
grunt.registerTask('default', [
'concat_sourcemap',
'removelogging',
'dev_prod_switch'
]);
};