forked from lutris/website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
142 lines (140 loc) · 3.64 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
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),
copy: {
main: {
files: [
{
expand: true,
flatten: true,
src: ["components/bootstrap/dist/fonts/*"],
dest: "public/fonts/"
},
{
expand: true,
flatten: true,
src: ["node_modules/ace-builds/src-noconflict/*"],
dest: "public/ace"
},
{
expand: true,
flatten: true,
src: ["node_modules/ace-builds/src-noconflict/snippets/*"],
dest: "public/ace/snippets"
}
]
}
},
less: {
css: {
options: {
sourceMap: true,
strictImports: true,
strictMath: true,
strictUnits: true,
paths: ["components/bootstrap/less/"]
},
files: {
"public/css/lutris.css": ["frontend/css/lutris.less"]
}
},
min: {
options: {
yuicompress: true,
sourceMap: true,
strictImports: true,
strictMath: true,
strictUnits: true,
paths: ["components/bootstrap/less/"]
},
files: {
"public/css/lutris.min.css": ["frontend/css/lutris.less"]
}
}
},
concat: {
app: {
src: ["frontend/js/*.js"],
dest: "public/js/app.js",
nonull: true
},
js: {
src: [
"components/jquery/dist/jquery.js",
"components/blueimp-canvas-to-blob/js/canvas-to-blob.js",
"components/bootstrap/dist/js/bootstrap.js",
"components/jssor/js/jssor.slider.min.js",
],
dest: "public/js/libs.js",
nonull: true
},
select2Js: {
src: ["components/select2/dist/js/select2.full.min.js"],
dest: "public/js/select2.min.js",
nonull: true
},
select2Css: {
src: [
"components/select2/dist/css/select2.min.css",
"components/select2-bootstrap-theme/dist/select2-bootstrap.min.css"
],
dest: "public/css/select2.min.css",
nonull: true
},
emailCss: {
src: ["frontend/css/email.css"],
dest: "public/css/email.css",
nonull: true
}
},
cssmin: {
dist: {
files: {
"public/css/libs.min.css": ["public/css/libs.css"],
"public/css/email.min.css": ["public/css/email.css"]
}
}
},
uglify: {
options: {
banner:
"/*! <%= pkg.name %> <%= grunt.template.today(\"dd-mm-yyyy\") %> */\n"
},
dist: {
files: {
"public/js/libs.min.js": ["public/js/libs.js"],
"public/js/app.min.js": ["public/js/app.js"]
}
}
},
watch: {
less: {
files: "frontend/css/**/*.less",
tasks: ["less:css", "less:min"]
},
templates: {
files: ["templates/**/*.html"]
}
},
browserSync: {
dev: {
bsFiles: {
src: ["templates/**", "public/**"]
},
options: {
proxy: "localhost:8000",
watchTask: true
}
}
}
});
grunt.loadNpmTasks("grunt-contrib-copy");
grunt.loadNpmTasks("grunt-contrib-concat");
grunt.loadNpmTasks("grunt-contrib-cssmin");
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.loadNpmTasks("grunt-browser-sync");
grunt.loadNpmTasks("grunt-contrib-less");
grunt.registerTask("default", ["copy", "less", "concat", "cssmin", "uglify"]);
grunt.registerTask("serve", ["browserSync", "watch"]);
};