-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGruntfile.js
More file actions
106 lines (86 loc) · 2.06 KB
/
Gruntfile.js
File metadata and controls
106 lines (86 loc) · 2.06 KB
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
module.exports = function(grunt) {
require('time-grunt')(grunt);
require('load-grunt-tasks')(grunt);
// configurable paths
var projectConfig = {
src: 'public',
build: 'public-built'
};
var banner = [
'/*! <%= pkg.name %> - v<%= pkg.version %> - \n',
'<%= grunt.template.today("yyyy-mm-dd") %> - <%= pkg.homepage %> */\n\n'
].join('');
grunt.initConfig({
conf: projectConfig,
pkg: grunt.file.readJSON('package.json'),
compass: {
dist: {
options: {
sassDir: '<%= conf.src %>/assets/styles/sass',
cssDir: '<%= conf.src %>/assets/styles'
}
}
},
copy: {
build: {
cwd: '<%= conf.src %>',
src: [ '**', '!**/*.scss' ],
dest: '<%= conf.build %>',
expand: true
},
},
requirejs: {
compile: {
options: {
baseUrl: "<%= conf.src %>/assets/scripts",
mainConfigFile: "<%= conf.src %>/assets/scripts/main.js",
out: "<%= conf.build %>/assets/scripts/main-min.js",
name: "../../bower_components/almond/almond",
include: 'main',
optimize: "uglify2"
}
}
},
clean: {
build: {
src: [ '<%= conf.build %>' ]
},
cleanUp: {
src: [
'<%= conf.build %>/assets/styles/*', '!<%= conf.build %>/assets/styles/main.css',
'<%= conf.build %>/assets/scripts/*', '!<%= conf.build %>/assets/scripts/main-min.js'
]
}
},
watch: {
css: {
files: '<%= conf.src %>/assets/styles/sass/**/*.scss',
tasks: ['compass']
}
},
processhtml: {
options: {
process: true,
data: {
message: 'Hello world!'
}
},
dist: {
files: {
'<%= conf.build %>/index.html': ['<%= conf.build %>/index.html']
}
}
}
});
grunt.registerTask(
'default',
'By default',
[ 'watch' ]
);
grunt.registerTask(
'build',
'Compiles all of the assets and copies the files to the build directory.',
// [ 'clean:build', 'copy', 'concat', 'uglify', 'clean:cleanUp' ]
[ 'clean', 'copy', 'processhtml:dist', 'requirejs', 'clean:cleanUp' ]
);
};