-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGruntfile.js
More file actions
75 lines (62 loc) · 2.15 KB
/
Gruntfile.js
File metadata and controls
75 lines (62 loc) · 2.15 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
/*jslint node: true */
module.exports = function(grunt) {
var path = require('path'),
cwd = process.cwd(),
dirs = {
src: 'resources/assets',
build: 'public/assets'
};
// Print the execution time for the tasks
require('time-grunt')(grunt);
// loads npm
require('load-grunt-tasks')(grunt);
// init grunt
require('load-grunt-config')(grunt, {
configPath: path.join(cwd, 'build/tasks'),
config: {
pkg: grunt.file.readJSON('package.json'),
build: {
paths: {
src: {
root: cwd,
dir: path.join(cwd, dirs.src),
js: path.join(cwd, dirs.src, 'js', 'src'),
css: path.join(dirs.src, 'css'),
images: path.join(dirs.src, 'images')
},
build: {
dir: path.join(dirs.build, '../'),
assets: path.join(dirs.build),
js: path.join(dirs.build, 'js'),
css: path.join(dirs.build, 'css'),
images: path.join(dirs.build, 'images'),
fonts: path.join(dirs.build, 'fonts')
},
lib: {
node: path.join(cwd, 'node_modules'),
bower: path.join(cwd, 'bower_components'),
composer: path.join(cwd, 'vendor')
}
},
banner: require('fs').readFileSync(path.join(cwd, 'build/banner.txt'), 'utf8')
}
}
});
// Default task
grunt.registerTask('default', 'debug');
// Common task
grunt.registerTask('common', [
'ngconstant',
'copy',
//'filerev',
'imagemin',
'usebanner'
]);
// Common task
grunt.registerTask('debug', [
'common',
'sass:debug',
'webpack:debug',
'clean:afterBuild'
]);
};