-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgruntfile.js
More file actions
80 lines (77 loc) · 2.18 KB
/
gruntfile.js
File metadata and controls
80 lines (77 loc) · 2.18 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
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
// Default task.
grunt.registerTask('default', ['jshint','build']);
grunt.registerTask('build', ['clean','concat:dist']);
grunt.registerTask('dev', ['clean','concat','copy']);
grunt.initConfig({
distdir: 'dist',
pkg: grunt.file.readJSON('package.json'),
banner:
'/*! <%= pkg.title || pkg.name %>-<%= pkg.version %> (<%= grunt.template.today("yyyy-mm-dd") %>)\n' +
'<%= pkg.homepage ? " * " + pkg.homepage + "\\n" : "" %>' +
' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author %>;\n' +
' * Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %>\n */\n',
src: {
js: ['src/*.js'],
},
clean: ['<%= distdir %>/*'],
copy: {
npm: {
files: [ {dest: '<%= distdir %>',
src: [
'underscore/underscore.js',
'json3/lib/json3.js'
],
expand: true,
flatten: true,
cwd: 'node_modules/'}]
},
vendor: {
files: [ {dest: '<%= distdir %>',
src: [ 'ngStorage/ngStorage.js' ],
expand: true,
flatten: true,
cwd: 'vendor/'}]
}
},
concat:{
dist:{
options: { banner: "<%= banner %>" },
src: ['<%= src.js %>'],
dest:'<%= distdir %>/<%= pkg.name %>.js'
},
angular: {
src: ['vendor/angular/angular.js',
'vendor/angular/angular-route.js',
'vendor/angular/angular-resource.js',
'vendor/angular/angular-underscore.js'],
dest: '<%= distdir %>/angular.js'
},
cryptojs: {
src: [ 'vendor/crypto-js/rollups/sha256.js',
'vendor/crypto-js/components/enc-base64.js' ],
dest: '<%= distdir %>/crypto.js'
}
},
jshint:{
files: ['gruntFile.js', '<%= src.js %>'],
options:{
curly: true,
eqeqeq: true,
immed: true,
latedef: true,
newcap: true,
noarg: true,
sub: true,
boss: true,
eqnull: true,
es5: true,
globals: {"angular": false}
}
}
});
};