Skip to content

Commit 08b50b3

Browse files
Fixes trentrichardson#723 - Adds build process for i18n into one file
1 parent 9a28b91 commit 08b50b3

File tree

4 files changed

+849
-1
lines changed

4 files changed

+849
-1
lines changed

Gruntfile.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,22 @@ module.exports = function(grunt) {
4646
'src/docs/footer.html'
4747
],
4848
dest: 'dist/index.html'
49+
},
50+
i18n: {
51+
options: {
52+
//stripBanners: true,
53+
banner: '<%=banner %>\n(function($){\n\n',
54+
footer: '\n})(jQuery);\n',
55+
process: function(src, filepath){
56+
return '// source: '+ filepath + '\n' +
57+
src.replace(/\(function\s*\(\$\)\s*\{/g, '')
58+
.replace(/\}\)\(jQuery\)\;/g, '')
59+
.replace(/\$\.timepicker\.setDefaults\(\$\.timepicker\.regional\[[a-z\-\'\"]+\]\)\;/gi, '')
60+
.trim() +'\n';
61+
}
62+
},
63+
src: [ 'src/i18n/jquery-ui-timepicker-*.js' ],
64+
dest: 'dist/i18n/<%=pkg.name %>-i18n.js'
4965
}
5066
},
5167
uglify: {
@@ -55,6 +71,10 @@ module.exports = function(grunt) {
5571
dist: {
5672
src: '<%= concat.dist.dest %>',
5773
dest: 'dist/<%= pkg.name %>.min.js'
74+
},
75+
i18n: {
76+
src: 'dist/i18n/<%=pkg.name %>-i18n.js',
77+
dest: 'dist/i18n/<%=pkg.name %>-i18n.min.js'
5878
}
5979
},
6080
cssmin: {

0 commit comments

Comments
 (0)