-
-
Notifications
You must be signed in to change notification settings - Fork 454
/
gruntfile.js
139 lines (129 loc) · 4.96 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
module.exports = function (grunt) {
require('matchdep')
.filterAll('grunt-*')
.forEach(grunt.loadNpmTasks)
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
express: {
options: {
// Override Defaults
},
web: {
options: {
script: 'app.js',
port: 8118
}
}
},
watch: {
web: {
files: ['*.js', 'src/**/*.js', 'plugins/**/*.js', '!src/public/**/*.js', '!src/client/**/*.js'],
tasks: ['express:web'],
options: {
nospawn: true,
atBegin: true
}
}
},
parallel: {
web: {
options: {
stream: true
},
tasks: [
{
grunt: true,
args: ['watch:web']
},
{
grunt: true,
args: ['shell:webpackWatch']
}
]
}
},
cssmin: {
target: {
files: {
'public/css/plugins.css': [
'public/css/plugins/datatables/dataTables.scroller.css',
'public/css/plugins/datatables/dataTables.foundation.css',
'src/public/js/vendor/chosen/chosen.css',
'src/public/js/vendor/enjoyhint/enjoyhint.css',
'src/public/js/vendor/metricsgraphics/metricsgraphics.css',
'public/css/plugins/simplecolorpicker/jquery.simplecolorpicker.css',
'public/css/plugins/simplecolorpicker/jquery.simplecolorpicker-fontawesome.css',
'src/public/js/vendor/uikit/css/uikit.css',
'src/public/js/vendor/uikit/css/uikit_custom.css',
'src/public/js/plugins/snackbar.css',
'src/public/js/vendor/c3/c3.css',
'src/public/js/vendor/multiselect/css/multi-select.css',
'src/public/js/vendor/formvalidator/theme-default.css',
'src/public/js/vendor/shepherd/css/shepherd-theme-default.css',
'src/public/js/vendor/shepherd/css/shepherd-theme-dark.css',
'src/public/js/vendor/shepherd/css/shepherd-theme-arrows.css',
'src/public/js/vendor/shepherd/css/shepherd-theme-arrows-fix.css',
'src/public/js/vendor/shepherd/css/shepherd-theme-square.css',
'src/public/js/vendor/shepherd/css/shepherd-theme-square-dark.css',
'src/public/js/vendor/easymde/dist/easymde.min.css',
'src/public/js/vendor/grapesjs/css/grapes.min.css',
'node_modules/react-grid-layout/css/styles.css',
'node_modules/react-resizable/css/styles.css'
]
}
},
minify: {
expand: true,
cwd: 'public/css/',
src: ['*.css', '!app.min.css', '!*.min.css'],
dest: 'public/css/',
ext: '.min.css'
}
},
uglify: {
uikit: {
options: {
beautify: false,
mangle: false
},
src: [
'src/public/js/vendor/uikit/js/uikit.js',
'src/public/js/vendor/uikit/js/components/accordion.js',
'src/public/js/vendor/uikit/js/components/autocomplete.js',
'src/public/js/vendor/uikit/js/components/datepicker.js',
'src/public/js/vendor/uikit/js/components/form-password.js',
'src/public/js/vendor/uikit/js/components/form-select.js',
'src/public/js/vendor/uikit/js/components/grid.js',
'src/public/js/vendor/uikit/js/components/htmleditor.js',
'src/public/js/vendor/uikit/js/components/lightbox.js',
'src/public/js/vendor/uikit/js/components/nestable.js',
'src/public/js/vendor/uikit/js/components/notify.js',
'src/public/js/vendor/uikit/js/components/pagination.js',
'src/public/js/vendor/uikit/js/components/parallax.js',
'src/public/js/vendor/uikit/js/components/grid-parallax.js',
'src/public/js/vendor/uikit/js/components/search.js',
'src/public/js/vendor/uikit/js/components/slider.js',
'src/public/js/vendor/uikit/js/components/slideshow.js',
'src/public/js/vendor/uikit/js/components/slideshow-fx.js',
'src/public/js/vendor/uikit/js/components/sortable.js',
'src/public/js/vendor/uikit/js/components/sticky.js',
'src/public/js/vendor/uikit/js/components/timepicker.js',
'src/public/js/vendor/uikit/js/components/tooltip.js',
'src/public/js/vendor/uikit/js/components/upload.js',
'src/public/js/vendor/uikit/js/custom.js'
],
dest: 'src/public/js/vendor/uikit/js/uikit_combined.min.js'
}
},
shell: {
webpackWatch: 'yarn run webpackwatch',
webpackDev: 'yarn run webpackdev',
webpackDist: 'yarn run webpackdist'
}
})
grunt.registerTask('buildcss', ['uglify:uikit', 'cssmin'])
grunt.registerTask('server', 'launch webserver and watch tasks', ['uglify:uikit', 'cssmin', 'parallel:web'])
grunt.registerTask('build', ['uglify:uikit', 'cssmin', 'shell:webpackDist'])
grunt.registerTask('devbuild', ['shell:webpackDev'])
grunt.registerTask('default', ['server'])
}