-
Notifications
You must be signed in to change notification settings - Fork 3
/
Gruntfile.js
118 lines (105 loc) · 2.84 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
var loadGruntTasks = require( 'load-grunt-tasks' );
var sass = require('sass');
module.exports = function( grunt ){
loadGruntTasks( grunt );
grunt.initConfig({
files: {
css: 'main_2018-04-29.css',
js: 'main_2018-04-29.min.js',
bootstrap: {
css: 'bootstrap_2016-08-31.css',
js: 'bootstrap_2016-08-31.min.js'
}
},
src: {
bootstrap: 'bootstrap-sass-3.3.7/assets',
scss: 'ui/static/ui/scss',
js: 'ui/static/ui/js'
},
dest: {
vendor: 'ui/static/vendor',
css: 'ui/static/ui/css',
js: 'ui/static/ui/js'
},
concat: {
bootstrap: {
src: [
//'<%= src.bootstrap %>/javascripts/bootstrap/transition.js',
//'<%= src.bootstrap %>/javascripts/bootstrap/alert.js',
'<%= src.bootstrap %>/javascripts/bootstrap/button.js'
//'<%= src.bootstrap %>/javascripts/bootstrap/carousel.js',
//'<%= src.bootstrap %>/javascripts/bootstrap/collapse.js',
//'<%= src.bootstrap %>/javascripts/bootstrap/dropdown.js',
//'<%= src.bootstrap %>/javascripts/bootstrap/modal.js',
//'<%= src.bootstrap %>/javascripts/bootstrap/tooltip.js',
//'<%= src.bootstrap %>/javascripts/bootstrap/popover.js'
//'<%= src.bootstrap %>/javascripts/bootstrap/scrollspy.js',
//'<%= src.bootstrap %>/javascripts/bootstrap/tab.js',
//'<%= src.bootstrap %>/javascripts/bootstrap/affix.js'
],
dest: '<%= dest.vendor %>/bootstrap/js/bootstrap.js'
},
js: {
options: {
sourceMap: true
},
src: [
'<%= src.js %>/ew.js',
'<%= src.js %>/ew.CustomEvent.js',
'<%= src.js %>/tools/ew.*.js',
'<%= src.js %>/**/ew.*.js'
],
dest: '<%= dest.js %>/main.js'
}
},
uglify: {
options: {
warnings: false,
mangle: true,
preserveComments: /^!|@preserve|@license|@cc_on/i,
sourceMap: true
},
bootstrap: {
src: '<%= concat.bootstrap.dest %>',
dest: '<%= dest.vendor %>/bootstrap/js/<%= files.bootstrap.js %>'
},
js: {
src: '<%= dest.js %>/main.js',
dest: '<%= dest.js %>/<%= files.js %>'
}
},
sass: {
options: {
implementation: sass,
sourceMap: true,
style: 'compact',
includePaths: [ '<%= src.bootstrap %>/stylesheets' ]
},
bootstrap: {
files: {
'<%= dest.vendor %>/bootstrap/css/<%= files.bootstrap.css %>': '<%= src.bootstrap %>/stylesheets/main.scss'
}
},
main: {
files: {
'<%= dest.css %>/<%= files.css %>': '<%= src.scss %>/main.scss'
}
}
},
watch: {
main: {
files: '<%= src.scss %>/**/*.scss',
tasks: [ 'sass:main' ]
},
bootstrap: {
files: '<%= src.bootstrap %>/stylesheets/**/*.scss',
tasks: [ 'sass:bootstrap' ]
},
js: {
files: [ '<%= src.js %>/**/*.js', '!<%= dest.js %>/main*.js' ],
tasks: [ 'concat:js', 'uglify:js' ]
}
}
});
grunt.registerTask( 'build', [ 'sass', 'concat', 'uglify' ] );
};