forked from kindsoft/kindeditor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
72 lines (66 loc) · 1.76 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
module.exports = function(grunt) {
var BANNER = '/* <%= pkg.name %> <%= pkg.version %> (<%= grunt.template.today("yyyy-mm-dd") %>), Copyright (C) kindsoft.net, Licence: http://www.kindsoft.net/license.php */\n';
grunt.initConfig({
pkg : grunt.file.readJSON('package.json'),
concat : {
options : {
banner : BANNER,
stripBanners : true,
block : true,
line : true
},
dist : {
src : [
'src/header.js',
'src/core.js',
'src/config.js',
'src/event.js',
'src/html.js',
'src/selector.js',
'src/node.js',
'src/range.js',
'src/cmd.js',
'src/widget.js',
'src/edit.js',
'src/toolbar.js',
'src/menu.js',
'src/colorpicker.js',
'src/uploadbutton.js',
'src/dialog.js',
'src/tabs.js',
'src/ajax.js',
'src/main.js',
'src/footer.js'
],
dest : 'kindeditor.js'
}
},
uglify : {
options : {
banner : BANNER
},
build : {
src : 'src/<%= pkg.name %>.js',
dest : 'build/<%= pkg.name %>.min.js'
}
},
compress: {
main: {
options: {
archive: 'dist/<%= pkg.filename %>-<%= pkg.version %>.zip'
},
files: [
{src: ['path/*'], dest: 'internal_folder/', filter: 'isFile'}, // includes files in path
{src: ['path/**'], dest: 'internal_folder2/'}, // includes files in path and its subdirs
{expand: true, cwd: 'path/', src: ['**'], dest: 'internal_folder3/'}, // makes all src relative to cwd
{flatten: true, src: ['path/**'], dest: 'internal_folder4/', filter: 'isFile'} // flattens results to a single level
]
}
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-compress');
grunt.registerTask('default', ['concat', 'embed', 'uglify']);
};