2013-07-25 09:46:03 +02:00
|
|
|
module.exports = function(grunt) {
|
|
|
|
grunt.initConfig({
|
2014-07-06 17:32:06 +02:00
|
|
|
jst: {
|
|
|
|
compile: {
|
|
|
|
options: {
|
2015-01-16 22:07:27 +01:00
|
|
|
namespace: 'templates',
|
2014-07-06 17:32:06 +02:00
|
|
|
templateSettings: {
|
|
|
|
evaluate : /\{\[([\s\S]+?)\]\}/g,
|
|
|
|
interpolate : /\{\{([\s\S]+?)\}\}/g
|
|
|
|
},
|
|
|
|
processName: function (filepath) {
|
|
|
|
// E.g. src/templates/trimmed_chat.html
|
|
|
|
return filepath.match(/src\/templates\/([a-z_]+)\.html/)[1];
|
|
|
|
|
|
|
|
}
|
|
|
|
},
|
|
|
|
files: {
|
2016-02-28 10:00:22 +01:00
|
|
|
"dist/templates.js": ["src/templates/*.html"]
|
2014-07-06 17:32:06 +02:00
|
|
|
},
|
|
|
|
}
|
|
|
|
},
|
2013-07-30 21:41:55 +02:00
|
|
|
cssmin: {
|
|
|
|
options: {
|
|
|
|
banner: "/*"+
|
|
|
|
"* Converse.js (Web-based XMPP instant messaging client) \n"+
|
|
|
|
"* http://conversejs.org \n"+
|
|
|
|
"* Copyright (c) 2012, Jan-Carel Brand <jc@opkode.com> \n"+
|
|
|
|
"* Dual licensed under the MIT and GPL Licenses \n"+
|
|
|
|
"*/"
|
|
|
|
},
|
|
|
|
minify: {
|
2014-06-29 20:49:22 +02:00
|
|
|
dest: 'css/converse.min.css',
|
|
|
|
src: ['css/converse.css']
|
2013-07-30 21:41:55 +02:00
|
|
|
}
|
2016-02-28 09:25:08 +01:00
|
|
|
},
|
|
|
|
json: {
|
|
|
|
main: {
|
|
|
|
options: {
|
|
|
|
namespace: 'locales',
|
|
|
|
includePath: true,
|
|
|
|
processName: function(filename) {
|
|
|
|
return filename.toLowerCase().match(/^locale\/(.*)\/lc_messages/)[1];
|
|
|
|
}
|
|
|
|
},
|
|
|
|
src: ['locale/**/LC_MESSAGES/*.json'],
|
2016-02-28 10:00:22 +01:00
|
|
|
dest: 'dist/locales.js'
|
2016-02-28 09:25:08 +01:00
|
|
|
}
|
2013-07-25 09:46:03 +02:00
|
|
|
}
|
|
|
|
});
|
2013-07-30 21:41:55 +02:00
|
|
|
grunt.loadNpmTasks('grunt-contrib-cssmin');
|
2014-07-06 17:32:06 +02:00
|
|
|
grunt.loadNpmTasks('grunt-contrib-jst');
|
2016-02-28 09:25:08 +01:00
|
|
|
grunt.loadNpmTasks('grunt-json');
|
2013-07-25 09:46:03 +02:00
|
|
|
};
|