-
Notifications
You must be signed in to change notification settings - Fork 2
/
Gruntfile.js
94 lines (85 loc) · 3.57 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
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// Less build
less: {
all: {
options: {
yuicompress: true
},
files: {
"server/public/css/main.css": "client/less/main.less"
}
}
},
// Copy assets
copy: {
main: {
files: [
{expand: true, cwd: 'client', src: ['index.html'], dest: 'server/public'},
{expand: true, cwd: 'client/partials', src: ['**'], dest: 'server/public/partials'},
{expand: true, cwd: 'client/images', src: ['**'], dest: 'server/public/images'},
{expand: true, cwd: 'node_modules/authenticatejs/build/partials', src: ['**'], dest: 'server/public/partials/authenticateJS'},
{expand: true, src: ['node_modules/font-awesome/fonts/*'], dest: 'server/public/font/', flatten: true},
{expand: true, src: ['node_modules/pmsipilot-ui/font/*'], dest: 'server/public/font/', flatten: true}
]
}
},
// Concat Files
concat: {
application: {
src: ['client/**/*.js'],
dest: 'server/public/js/app.js'
},
vendors: {
src: [
'node_modules/jquery/dist/jquery.min.js',
'node_modules/angular/angular.min.js',
'node_modules/angular-route/angular-route.min.js',
'node_modules/angular-sanitize/angular-sanitize.min.js',
'node_modules/angular-bootstrap/ui-bootstrap-tpls.min.js',
'node_modules/bootstrap/dist/js/bootstrap.min.js',
'node_modules/ng-table/bundles/ng-table.min.js',
'node_modules/d3/d3.min.js',
'node_modules/authenticatejs/src/js/module.js',
'node_modules/authenticatejs/src/js/**/*.js',
'node_modules/angular-datastore/src/module.js',
'node_modules/angular-datastore/src/**/*.js',
'node_modules/marked/marked.min.js',
'node_modules/angular-marked/dist/angular-marked.min.js',
'node_modules/moment/moment.js',
'node_modules/angular-gravatar/build/angular-gravatar.min.js'
],
dest: 'server/public/js/vendor.js'
},
vendors_stylesheets: {
src: [
'node_modules/ng-table/bundles/ng-table.min.css'
],
dest: 'server/public/css/vendor.css'
}
},
uglify: {
application: {
options: {
compress: true,
mangle: false,
output: {
comments: false
}
},
files: {
'server/public/js/app.js': ['server/public/js/app.js'],
'server/public/js/vendor.js': ['server/public/js/vendor.js']
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', ['less', 'copy', 'concat', 'uglify']);
};