-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathGruntfile.js
executable file
·78 lines (78 loc) · 2.12 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
module.exports = function(grunt) {
grunt.initConfig({
pkg : grunt.file.readJSON('package.json'),
bower: {
install: {
options: {
targetDir: './lib',
layout: 'byComponent',
install: true,
verbose: true,
cleanTargetDir: true,
cleanBowerDir: false,
bowerOptions: {}
}
}
},
sass: {
dist: {
files: {
'dist/css/app.css': 'dev/scss/main.scss'
}
}
},
concat: {
css: {
src: [ "lib/font-awesome/css/font-awesome.css", "lib/js-object-renderer/ObjectRenderer.css", "dist/css/app.css" ],
dest: 'dist/css/app.css'
},
js: {
src : [ "lib/js-object-renderer/lib/prototype.js", "lib/js-object-renderer/ObjectRenderer.js", "lib/modernizr/modernizr.js", "lib/jquery/jquery.js", "dev/js/jqnc.js", "lib/jquery-xmlrpc/jquery.xmlrpc.js", "lib/foundation/js/foundation.js", "lib/xml-pretty-print/xml-prettify.js", "dev/js/main.js" ],
dest : 'dist/js/app.js'
}
},
copy: {
main: {
files: [
{ expand: true, cwd: "lib/font-awesome/fonts/", src: [ "*" ], dest: 'dist/fonts/' },
{ expand: true, cwd: "lib/angular/", src: [ "*" ], dest: 'dist/js/angular/' },
{ expand: true, cwd: "dev/img/", src: [ "*" ], dest: 'dist/img/' },
{ expand: true, cwd: "dev/js/", src: [ "event.js" ], dest: 'dist/js/' },
{ expand: true, cwd: "dev/", src: [ "main.html", "manifest.json" ], dest: 'dist/' }
]
}
},
clean: ['bower_components'],
watch: {
pages: {
files: ['dev/*'],
tasks: ['dist'],
options: {
spawn: false,
}
},
scss: {
files: ['dev/scss/*'],
tasks: ['dist'],
options: {
spawn: false,
}
},
scripts: {
files: ['dev/js/*'],
tasks: ['concat:js','copy'],
options: {
spawn: false,
}
}
}
});
grunt.loadNpmTasks('grunt-bower-task');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.registerTask('dist', [ 'sass', 'concat', 'copy', 'clean' ]);
grunt.registerTask('init', [ 'bower', 'dist' ]);
};