forked from skyronic/crudkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
144 lines (139 loc) · 4.2 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
140
141
142
143
144
module.exports = function(grunt) {
var vendorRoot = "src/static/vendor/";
var buildRoot = "src/static/build/";
var tempRoot = "src/static/temp/";
grunt.initConfig({
watch: {
lessFiles: {
files: ["src/static/less/*.less"],
tasks: ['less:main']
}
},
copy: {
temp: {
files: [{
expand: true,
cwd: vendorRoot + 'bootstrap/dist/',
src: ["fonts/*"],
dest: buildRoot
}, {
expand: true,
cwd: vendorRoot + 'adminlte/dist/',
src: [
"img/boxed-bg.png",
"img/boxed-bg.jpg",
"img/default-50x50.gif",
"img/icons.png"
],
dest: buildRoot
}, {
expand: true,
cwd: vendorRoot + 'fontawesome/',
src: ["fonts/*"],
dest: buildRoot
}, ]
},
build: {
files: [{
expand: true,
cwd: vendorRoot + 'bootstrap/dist/',
src: ["fonts/*"],
dest: tempRoot
}, {
expand: true,
cwd: vendorRoot + 'adminlte/dist/',
src: ["img/*"],
dest: tempRoot
}, {
expand: true,
cwd: vendorRoot + 'fontawesome/',
src: ["fonts/*"],
dest: tempRoot
}]
}
},
less: {
main: {
files: {
"src/static/temp/crudkit.css": "src/static/less/crudkit.less"
}
}
},
concat: {
build_css: {
files: {
"src/static/build/css/crudkit.min.css": [
"src/static/temp/css/crudkit-libs.min.css",
"src/static/temp/crudkit.css"
]
}
},
build_js: {
options: {
separator: ";\n"
},
files: {
"src/static/build/js/crudkit.min.js": [
"src/static/temp/js/crudkit-libs.min.js",
"src/static/js/app.js"
]
}
},
css: {
files: {
"src/static/temp/css/crudkit-libs.min.css": [
vendorRoot + "bootstrap/dist/css/bootstrap.min.css",
vendorRoot + "angular-busy/dist/angular-busy.min.css",
vendorRoot + "adminlte/dist/css/AdminLTE.min.css",
vendorRoot + "adminlte/dist/css/skins/skin-blue.css",
vendorRoot + "fontawesome/css/font-awesome.min.css",
vendorRoot + "bootstrap3-dialog/dist/css/bootstrap-dialog.min.css"
]
}
},
js: {
options: {
separator: ";\n"
},
files: {
"src/static/temp/js/crudkit-libs.min.js": [
vendorRoot + "jquery/dist/jquery.min.js",
vendorRoot + "bootstrap/dist/js/bootstrap.min.js",
vendorRoot + "lodash/lodash.min.js",
vendorRoot + "angularjs/angular.min.js",
vendorRoot + "angular-animate/angular-animate.min.js",
vendorRoot + "angular-busy/dist/angular-busy.min.js",
vendorRoot + "angular-filter/dist/angular-filter.min.js",
vendorRoot + "bootstrap3-dialog/dist/js/bootstrap-dialog.min.js",
vendorRoot + "jsurl/url.min.js",
vendorRoot + "moment/min/moment.min.js",
vendorRoot + "moment-timezone/builds/moment-timezone-with-data.min.js",
vendorRoot + "adminlte/dist/js/app.min.js",
"src/static/extra/ui-bootstrap-custom-0.13.0.min.js",
"src/static/extra/ui-bootstrap-custom-tpls-0.13.0.min.js"
]
}
}
},
clean: {
},
replace: {
sourceMaps: {
src: ["src/static/temp/js/crudkit-libs.min.js", "src/static/temp/css/crudkit-libs.min.css"],
overwrite: true,
replacements: [{
from: "sourceMappingURL",
to: ""
}]
}
}
});
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-text-replace');
grunt.registerTask('build', ['less', 'concat:js', 'concat:css', 'replace', 'copy:temp']);
grunt.registerTask('release', ['build', 'concat:build_css', 'concat:build_js', 'copy:build']);
};