-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
112 lines (99 loc) · 3.35 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
"use strict";
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
connect: {
server: {
options: {
port: 8080,
base: './dist'
}
}
},
bower: {
install: {
//just run 'grunt bower:install' and you'll see files from your Bower packages in lib directory
}
},
copy: {
main: {
files: [
// includes files within path and its sub-directories
{
expand: true,
cwd: 'bower_components/jquery/dist',
src: ['**'],
dest: 'dist/lib/jquery/'
}, {
expand: true,
cwd: 'bower_components/magic',
src: ['*.css'],
dest: 'dist/lib/magic/'
}, {
expand: true,
cwd: 'bower_components/bootstrap/dist',
src: ['**'],
dest: 'dist/lib/bootstrap/'
}, {
expand: true,
src: ['krunch/**'],
dest: 'dist/'
}, {
expand: true,
src: ['newsmedia/**'],
dest: 'dist/'
}
]
},
resources: {
files: [{
expand: true,
src: ['resources/**'],
dest: 'dist/'
}]
},
wiki: {
files: [{
expand: true,
src: ['wiki/**'],
dest: 'dist/'
}]
},
htmlfiles: {
files: [{
expand: true,
src: ['*.html', "*.css","*.png"],
dest: 'dist/',
filter: 'isFile'
}],
options: {
process: function(content, srcpath) {
var res = content.replace(/bower_components\/(.*)\/dist/g, "lib/\$1");
res = res.replace(/bower_components\/magic/g, "lib/magic");
return res;
},
noProcess: '**/*.{png,gif,jpg,jpeg,ico,psd}' // Since the property was renamed
}
}
},
watch: {
files: ['**/*.html', "**/*.md", "**/*.css", "wiki/**/*.*", "!dist/**"],
tasks: ["copyfiles"]
},
open: {
dev: {
path: 'http://localhost:8080/'
}
}
});
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-open');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-bower-task');
// Default task(s).
grunt.registerTask('copyfiles', ['copy:main', 'copy:htmlfiles', "copy:resources", "copy:wiki"]);
grunt.registerTask('default', ['bower:install','copyfiles', 'connect', 'open', "watch"]);
grunt.registerTask('build', ['bower:install','copyfiles']);
};