forked from bodyno/front-end-separate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
76 lines (51 loc) · 1.61 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
module.exports = function (grunt) {
require('time-grunt')(grunt);
require('load-grunt-tasks')(grunt);
// 加载项目配置
var configApp = require('./config/app');
// 路径配置
var appConfig = configApp.path;
// grunt配置
var config = {
// 路径配置
yo: appConfig,
clean: require('./config/grunt/clean'),
copy: require('./config/grunt/copy'),
sass: require('./config/grunt/sass'),
postcss: require('./config/grunt/postcss'),
uglify: require('./config/grunt/uglify'),
cssmin: require('./config/grunt/cssmin'),
useminPrepare: require('./config/grunt/usemin-prepare'),
usemin: require('./config/grunt/usemin')(),
sprite: require('./config/grunt/sprite'),
filerev: require('./config/grunt/filerev'),
nodemon: require('./config/grunt/nodemon')(),
coffee: require('./config/grunt/coffee'),
concurrent: require('./config/grunt/concurrent'),
compress: require('./config/grunt/compress'),
htmlclean: require('./config/grunt/htmlclean')
};
//加载grunt
grunt.initConfig(config);
// 注册代码编译任务
grunt.registerTask('build', [
'clean:dist',
'concurrent:copy',
'useminPrepare',
'sass:build',
'postcss',
'concat',
'uglify',
'cssmin',
'filerev',
'copy:vm',
'usemin',
'htmlclean',
'concurrent:clean',
'compress'
]);
// 注册Grunt默认任务
grunt.registerTask('default', [
'nodemon'
]);
};