-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
68 lines (59 loc) · 1.93 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
"use strict";
module.exports = function(grunt) {
require("load-grunt-tasks")(grunt);
var config = {
clean: ["dist"],
less: {
development: {
files: {
"dist/css/style.css": "src/less/style.less"
}
}
},
cssmin: {
target: {
files: [{
expand: true,
cwd: 'dist/css',
src: ['*.css', '!*.min.css'],
dest: 'dist/css',
ext: '.min.css'
}]
}
},
copy: {
main: {
files: [
{ expand: true, flatten: true, cwd: "src/", src: ["CNAME"], dest: "dist/" },
{ expand: true, flatten: true, cwd: "src/", src: ["favicon.ico"], dest: "dist/" },
{ expand: true, cwd: "src/", src: ["*.html"], dest: "dist/" },
{ expand: true, cwd: "src/", src: ["js/**/*.js"], dest: "dist/" },
{ expand: true, cwd: "assets/", src: ["**/*.*"], dest: "dist/" },
{ expand: true, flatten: true, cwd: "node_modules/", src: ["elq/dist/*.js"], dest: "dist/js/elq/" },
{ expand: true, flatten: true, cwd: "node_modules/", src: ["tabs/*.js"], dest: "dist/js/tabs/" }
]
}
},
watch: {
scripts: {
files: ['src/**/*.less', 'src/**/*.js', 'src/**/*.html'],
tasks: ['build'],
options: {
spawn: false,
},
},
},
connect: {
server: {
options: {
port: 8000,
hostname: '*',
base: 'dist'
}
}
}
};
grunt.initConfig(config);
grunt.registerTask("build", ["clean", "less:development", "cssmin", "copy:main"]);
grunt.registerTask("default", ["build", "connect", "watch"]);
};