-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
91 lines (87 loc) · 2.6 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
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {// Task
app: {// Target
options: {// Target options
compass: true,
style: 'nested', //expanded
require: 'sass-css-importer'
},
files: {// Dictionary of files
'app/build/css/app.css': 'app/css/app.scss' // 'destination': 'source'
}
}
},
browserify: {
app: {
src: [
'app/js/core.js'
],
dest: 'app/build/js/app.js'
}
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n',
compress: false,
mangle: false,
beautify: false
},
platform: {
src: [
'app/bower_components/jquery/dist/jquery.min.js',
'app/bower_components/slick-carousel/slick/slick.js',
'app/bower_components/photoswipe/dist/photoswipe.js',
'app/bower_components/photoswipe/dist/photoswipe-ui-default.js',
'app/bower_components/datatables/media/js/jquery.dataTables.min.js',
'app/js/bootstrapDataTables.js',
'app/bower_components/angular/angular.js',
'app/bower_components/angular-slick/dist/slick.js',
'app/bower_components/angular-route/angular-route.min.js',
'app/bower_components/angular-resource/angular-resource.min.js',
'app/bower_components/lodash/dist/lodash.min.js',
'app/bower_components/restangular/dist/restangular.min.js',
'app/bower_components/datetimepicker/jquery.datetimepicker.js',
'app/bower_components/magnific-popup/dist/jquery.magnific-popup.min.js',
'app/bower_components/angular-datatables/dist/angular-datatables.min.js',
'app/bower_components/ng-flow/dist/ng-flow-standalone.min.js',
'app/bower_components/jquery-ui/jquery-ui.min.js',
'app/bower_components/angular-ui-sortable/sortable.min.js',
'app/bower_components/angular-animate/angular-animate.js',
'app/bower_components/bootstrap-sass/assets/javascripts/bootstrap.js',
'app/js/common.js',
],
dest: 'app/build/js/platform.min.js'
},
app: {
src: [
'app/build/js/app.js'
],
dest: 'app/build/js/app.min.js'
}
},
watch: {
sass: {
files: 'app/css/**/*.scss',
tasks: ['sass']
},
browserify: {
files: [
'Gruntfile.js',
'app/js/**/*.js',
'app/modules/**/*.js'
],
tasks: ['browserify', 'uglify'],
options: {
reload: true
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-browserify');
grunt.registerTask('default', ['sass', 'browserify']);
};