-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathGruntfile.js
36 lines (30 loc) · 1.07 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
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
options: {},
dist: {
src: ['src/**/*.js'], //src文件夹下包括子文件夹下的所有文件
dest: 'dist/<%= pkg.name %>.js' //合并文件在dist下名为merge-table.js的文件
}
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
},
build: {
src: 'dist/<%= pkg.name %>.js', //压缩源文件是之前合并的merge-table.js文件
dest: 'dist/<%= pkg.name %>.min.js' //压缩文件为merge-table.min.js
}
}
});
// Load the plugin that provides the "concat" task.
grunt.loadNpmTasks('grunt-contrib-concat');
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-uglify');
// Load the plugin that provides the "bower" task.
grunt.loadNpmTasks('grunt-bower-task');
// Default task(s).
grunt.registerTask('default', ['concat', 'uglify']);
};