mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-21 21:09:28 +00:00
Improve build scripts of Web frontend
This commit is contained in:
@@ -4,7 +4,8 @@ module.exports = function(grunt) {
|
||||
|
||||
sass: {
|
||||
options: {
|
||||
includePaths: ['bower_components/foundation/scss']
|
||||
includePaths: ['bower_components/foundation/scss',
|
||||
'bower_components/ionic/scss']
|
||||
},
|
||||
dist: {
|
||||
options: {
|
||||
@@ -14,7 +15,8 @@ module.exports = function(grunt) {
|
||||
files: {
|
||||
'css/app.css': 'scss/app.scss',
|
||||
'css/SOGoRootPage.css': 'scss/SOGoRootPage.scss',
|
||||
'css/ContactsUI.css': 'scss/ContactsUI.scss'
|
||||
'css/ContactsUI.css': 'scss/ContactsUI.scss',
|
||||
'css/mobile.css': 'scss/mobile.scss'
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -34,4 +36,27 @@ module.exports = function(grunt) {
|
||||
|
||||
grunt.registerTask('build', ['sass']);
|
||||
grunt.registerTask('default', ['build','watch']);
|
||||
grunt.registerTask('js', function(dev) {
|
||||
var options = {
|
||||
'src': 'bower_components',
|
||||
'dest': 'js/vendor/',
|
||||
'min': (dev? '' : '.min')
|
||||
};
|
||||
var vendor = [
|
||||
'<%= src %>/angular/angular<%= min %>.js',
|
||||
'<%= src %>/angular-sanitize/angular-sanitize<%= min %>.js',
|
||||
'<%= src %>/angular-ui-router/release/angular-ui-router<%= min %>.js',
|
||||
'<%= src %>/angular-foundation/mm-foundation-tpls<%= min %>.js',
|
||||
'<%= src %>/foundation/js/foundation<%= min %>.js',
|
||||
'<%= src %>/ionic/release/js/ionic<%= min %>.js',
|
||||
'<%= src %>/underscore/underscore-min.js'
|
||||
];
|
||||
for (var i = 0; i < vendor.length; i++) {
|
||||
var src = grunt.template.process(vendor[i], {data: options});
|
||||
var paths = src.split('/');
|
||||
var dest = options.dest + paths[paths.length-1];
|
||||
grunt.file.copy(src, dest);
|
||||
grunt.log.ok("copy " + src + " => " + dest);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user