From 15df09af2a7d3ddd6289f3f22f70ed8d4fd614ca Mon Sep 17 00:00:00 2001 From: Peter Grassberger Date: Fri, 5 Feb 2016 00:59:32 +0100 Subject: build with grunt diff --git a/.gitignore b/.gitignore index 0e7aed8..9a749fe 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ contrib/Pflichtenheft-Peter.pdf +node_modules +www/js/rhwebimport.* +www/styles/rhwebimport.* diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 0000000..4993def --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,64 @@ +module.exports = function(grunt) { + + // Project configuration. + grunt.initConfig({ + pkg: grunt.file.readJSON('package.json'), + concat: { + js: { + src: [ + 'www/js/dropzone.js', + 'www/js/apps.js', + 'www/js/auth.js', + 'www/js/clock.js', + 'www/js/importer.js', + 'www/js/jingles.js', + 'www/js/musicgrid.js', + 'www/js/musicpools.js', + 'www/js/rivendell.js', + 'www/js/rivendell.rh.js', + 'www/js/shows.js', + 'www/js/utils.js' + ], + dest: 'www/js/<%= pkg.name %>.js' + }, + css: { + src: [ + 'www/styles/auth.css', + 'www/styles/jingles.css', + 'www/styles/main-style.css', + 'www/styles/musicgrid.css', + 'www/styles/shows.css' + ], + dest: 'www/styles/<%= pkg.name %>.css' + } + }, + uglify: { + options: { + banner: '/*! <%= pkg.name %> */\n' + }, + build: { + src: 'www/js/<%= pkg.name %>.js', + dest: 'www/js/<%= pkg.name %>.min.js' + } + }, + cssmin: { + target: { + files: [{ + expand: true, + cwd: 'www/styles', + src: '<%= pkg.name %>.css', + dest: 'www/styles', + ext: '.min.css' + }] + } + } + }); + + // Load the plugin that provides the "uglify" task. + grunt.loadNpmTasks('grunt-contrib-concat'); + grunt.loadNpmTasks('grunt-contrib-uglify'); + grunt.loadNpmTasks('grunt-contrib-cssmin'); + + // Default task(s). + grunt.registerTask('default', ['concat', 'uglify', 'cssmin']); +}; diff --git a/README b/README index 9899324..7d6b2d2 100644 --- a/README +++ b/README @@ -31,7 +31,7 @@ LICENSE Installation ============ -# sudo aptitude install apache2 libapache2-mpm-itk libapache2-mod-perl2 libconfig-inifiles-perl libdbd-mysql-perl libjson-pp-perl libxml-quote-perl librhrd-perl libjs-jquery rivendell-server +# sudo aptitude install apache2 libapache2-mpm-itk libapache2-mod-perl2 libconfig-inifiles-perl libdbd-mysql-perl libjson-pp-perl libxml-quote-perl librhrd-perl libjs-jquery rivendell-server npm # sudo a2enmod ssl authnz_ldap perl proxy_wstunnel # sudo /etc/init.d/apache2 restart @@ -86,3 +86,7 @@ add the following to the virtualhost config: AliasMatch "^/(js|img|styles)(.*)" "/var/www/rhwebimport/www/$1$2" AliasMatch "^(.*)" "/var/www/rhwebimport/www/index.html" ~~~/snip~~~ + +# npm install +# npm install -g grunt-cli +# grunt diff --git a/package.json b/package.json new file mode 100644 index 0000000..6c0d39d --- /dev/null +++ b/package.json @@ -0,0 +1,10 @@ +{ + "name": "rhwebimport", + "version": "0.0.1", + "devDependencies": { + "grunt": "^0.4.5", + "grunt-contrib-concat": "^0.5.1", + "grunt-contrib-cssmin": "^0.14.0", + "grunt-contrib-uglify": "^0.11.1" + } +} diff --git a/www/index.html b/www/index.html index 2a3f28f..aa780d9 100644 --- a/www/index.html +++ b/www/index.html @@ -9,26 +9,10 @@ - - - - - - + - - - - - - - - - - - - + -- cgit v0.10.2