2016-03-24 02:03:42 +01:00
|
|
|
module.exports = function (grunt) {
|
2016-05-02 21:40:26 +02:00
|
|
|
|
2016-08-21 19:58:55 +02:00
|
|
|
var uglifyAssetcfg = {};
|
|
|
|
uglifyAssetcfg[grunt.option('to')] = grunt.option('from');
|
|
|
|
var cssMinAssetcfg = {};
|
|
|
|
cssMinAssetcfg[grunt.option('to')] = [grunt.option('from')];
|
|
|
|
|
|
|
|
grunt.log.write(grunt.option('from'));
|
2016-08-23 22:29:34 +02:00
|
|
|
|
2016-03-24 02:03:42 +01:00
|
|
|
grunt.initConfig({
|
2016-08-21 19:58:55 +02:00
|
|
|
pkg: grunt.file.readJSON('package.json'),
|
2016-03-24 02:03:42 +01:00
|
|
|
concat: {
|
2016-05-02 21:40:26 +02:00
|
|
|
options: {
|
|
|
|
separator: ';',
|
|
|
|
},
|
|
|
|
dist: {
|
|
|
|
src: ['js/humhub.core.js', 'js/humhub.util.js', 'js/humhub.additions.js',
|
|
|
|
'js/humhub.client.js', 'js/humhub.ui.js', 'js/humhub.ui.modal.js', 'js/humhub.actions.js',
|
|
|
|
'js/humhub.content.js', 'js/humhub.stream.js'],
|
|
|
|
dest: 'js/dist/humhub.all.js'
|
|
|
|
}
|
2016-03-24 02:03:42 +01:00
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
js: {
|
|
|
|
files: ['js/*.js'],
|
|
|
|
tasks: ['build']
|
|
|
|
}
|
|
|
|
},
|
2016-04-19 15:47:05 +02:00
|
|
|
clean: ["assets/*"],
|
|
|
|
uglify: {
|
|
|
|
build: {
|
|
|
|
files: {
|
2016-05-02 21:40:26 +02:00
|
|
|
'js/dist/humhub.all.min.js': ['js/dist/humhub.all.js']
|
|
|
|
}
|
2016-08-21 19:58:55 +02:00
|
|
|
},
|
|
|
|
assets: {
|
2016-08-23 22:29:34 +02:00
|
|
|
options: {
|
|
|
|
preserveComments: /^!|@preserve|@license|@cc_on/i,
|
|
|
|
//preserveComments: 'all',
|
|
|
|
// ASCIIOnly: true,
|
|
|
|
/*beautify: {
|
|
|
|
"ascii_only": true
|
|
|
|
},*/
|
|
|
|
},
|
2016-08-21 19:58:55 +02:00
|
|
|
files: uglifyAssetcfg
|
|
|
|
}
|
|
|
|
},
|
|
|
|
cssmin: {
|
|
|
|
target: {
|
|
|
|
files: cssMinAssetcfg
|
2016-05-02 21:40:26 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
less: {
|
|
|
|
dev: {
|
|
|
|
files: {
|
|
|
|
'themes/HumHub/css/less/theme.css': 'themes/HumHub/css/less/theme.less'
|
2016-04-19 15:47:05 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-03-24 02:03:42 +01:00
|
|
|
});
|
2016-05-02 21:40:26 +02:00
|
|
|
grunt.loadNpmTasks('grunt-contrib-less');
|
2016-03-24 02:03:42 +01:00
|
|
|
grunt.loadNpmTasks('grunt-contrib-concat');
|
2016-04-19 15:47:05 +02:00
|
|
|
grunt.loadNpmTasks('grunt-contrib-uglify');
|
2016-08-21 19:58:55 +02:00
|
|
|
grunt.loadNpmTasks('grunt-contrib-cssmin');
|
2016-03-24 02:03:42 +01:00
|
|
|
grunt.loadNpmTasks('grunt-contrib-watch');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-clean');
|
|
|
|
grunt.registerTask('default', ['watch']);
|
2016-04-19 15:47:05 +02:00
|
|
|
grunt.registerTask('build', ['concat', 'uglify', 'clean']);
|
2016-08-23 22:29:34 +02:00
|
|
|
|
2016-04-19 15:47:05 +02:00
|
|
|
};
|