Skip to content

Commit b839258

Browse files
committed
build
1 parent be5265e commit b839258

10 files changed

Lines changed: 91 additions & 301 deletions

File tree

Gruntfile.js

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ var PLUGIN_FILES = [
5454

5555
var pkg = grunt.file.readJSON('package.json');
5656

57+
var lang = grunt.option('lang') || 'en';
58+
5759
grunt.initConfig({
5860
pkg : pkg,
5961
concat : {
@@ -67,15 +69,11 @@ grunt.initConfig({
6769
src = src.replace(/[ \t]+$/mg, '');
6870
src = src.replace(/(\r\n|\n){2,}/g, '$1');
6971
return src;
70-
},
71-
},
72-
zh_CN : {
73-
src : SRC_FILES.concat('lang/zh_CN.js').concat(PLUGIN_FILES),
74-
dest : 'kindeditor-all.js',
72+
}
7573
},
76-
en : {
77-
src : SRC_FILES.concat('lang/en.js').concat(PLUGIN_FILES),
78-
dest : 'kindeditor-all.js',
74+
build : {
75+
src : SRC_FILES.concat('lang/' + lang + '.js').concat(PLUGIN_FILES),
76+
dest : 'kindeditor-all.js'
7977
}
8078
},
8179
uglify : {
@@ -84,23 +82,23 @@ grunt.initConfig({
8482
},
8583
build : {
8684
src : '<%= pkg.filename %>-all.js',
87-
dest : '<%= pkg.filename %>-all-min.js',
85+
dest : '<%= pkg.filename %>-all-min.js'
8886
}
8987
},
9088
compress : {
9189
main : {
9290
options: {
93-
archive: 'dist/<%= pkg.filename %>-<%= pkg.version %>.zip',
91+
archive: 'dist/<%= pkg.filename %>-<%= pkg.version %>-' + lang + '.zip',
9492
},
9593
files: [
9694
{src: ['asp/**'], dest: 'kindeditor/'},
9795
{src: ['asp.net/**'], dest: 'kindeditor/'},
9896
{src: ['attached'], dest: 'kindeditor/'},
9997
{src: ['jsp/**'], dest: 'kindeditor/'},
98+
{src: ['lang/**'], dest: 'kindeditor/'},
10099
{src: ['php/**'], dest: 'kindeditor/'},
101100
{src: ['plugins/**'], dest: 'kindeditor/'},
102101
{src: ['themes/**'], dest: 'kindeditor/'},
103-
{src: ['themes/**'], dest: 'kindeditor/'},
104102
{src: ['kindeditor*.js'], dest: 'kindeditor/'},
105103
{src: ['license.txt'], dest: 'kindeditor/'},
106104
]
@@ -112,8 +110,9 @@ grunt.loadNpmTasks('grunt-contrib-concat');
112110
grunt.loadNpmTasks('grunt-contrib-uglify');
113111
grunt.loadNpmTasks('grunt-contrib-compress');
114112

115-
grunt.registerTask('zh_CN', ['concat:zh_CN', 'uglify']);
116-
grunt.registerTask('en', ['concat:en', 'uglify']);
117-
grunt.registerTask('zip', ['compress']);
113+
grunt.registerTask('build', ['concat', 'uglify']);
114+
grunt.registerTask('zip', ['build', 'compress']);
115+
116+
grunt.registerTask('default', 'build');
118117

119118
};

kindeditor-all-min.js

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)