This repository has been archived by the owner on Jun 23, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gruntfile.js
95 lines (75 loc) · 2.55 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
90
91
92
93
94
95
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
mkdir:{
all: {
options: {
mode: 0766,
create: ['cache']
}
}
},
concat: {
options: {
separator: ''
},
dist: {
src: ['public/js/angular.min.js'
,'public/js/angular-route.js'
,'public/js/angular-touch.js'
,'public/js/angular-translate.js'
,'public/js/canvasjs.js'
,'public/js/intouch.js'
,'public/js/directive.js'
,'public/js/factory.js'
,'public/js/controllers/*.js'],
dest: 'dist/public/js/<%= pkg.name %>.js'
},
css: {
src: ['public/css/animations.css'
,'public/css/bootstrap.css'
,'public/css/style.css'],
dest: 'dist/public/css/<%= pkg.name %>.css'
}
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n',
mangle: false,
sourceMap: 'dist/public/js/<%= pkg.name %>.min.map',
sourceMappingURL: '<%= pkg.name %>.min.map', //points to the .map file in .min.js
sourceMapPrefix: 3
},
dist: {
files: {
'dist/public/js/<%= pkg.name %>.min.js': ['<%= concat.dist.dest %>']
}
}
},
copy:{
main: {
files: [
// includes files within path and its sub-directories
{expand: true, src: ['package.json'], dest: 'dist/'} ,
{expand: true, src: ['public/**'], dest: 'dist/'},
{expand: true, src: ['views/**'], dest: 'dist/'},
{expand: true, src: ['routes/**'], dest: 'dist/'},
{expand: true, src: ['app.js'], dest: 'dist/'}
]
}
},
// Performs rewrites based on rev and the useminPrepare configuration
usemin: {
html: ['dist/public/index.html'],
options: {
assetsDirs: ['dist']
}
}
});
grunt.loadNpmTasks('grunt-mkdir');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-usemin');
grunt.registerTask('default', ['copy','concat', 'uglify','mkdir','usemin']);
};