forked from highsea/hi-cms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
executable file
·37 lines (37 loc) · 1.25 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
module.exports = function(grunt) {
//init初始化
grunt.initConfig({
//读取 package
pkg : grunt.file.readJSON('package.json'),
//合并插件的 设置
concat : {
options : {
stripBanners: true,
// 正则匹配文件
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %> */',
},
// 原始位置,输出位置
dist : {
src: ['public/javascripts/a.js', 'public/javascripts/b.js'],
dest: 'public/assets/built.js'
}
},
//压缩插件的设置
uglify : {
options : {
banner : '/*! <%= pkg.name %> '+
'<%= grunt.template.today("yyyy-mm-dd") %> */\n'
},
build : {
src : 'public/assets/built.js',
dest : 'public/assets/built.min.js'
}
}
});
//载入执行依赖
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
//注册任务
grunt.registerTask('default', ['concat', 'uglify']);
};