1
0
Fork 0

upgrading to grunt 0.4. resolves #349.

This commit is contained in:
Boaz Sender 2013-02-27 02:26:24 -05:00
parent a9b4eb9a05
commit 14105feb10
2 changed files with 53 additions and 51 deletions

View File

@ -3,19 +3,11 @@ module.exports = function(grunt) {
// Project configuration // Project configuration
grunt.initConfig({ grunt.initConfig({
pkg: '<json:package.json>', pkg: grunt.file.readJSON('package.json'),
inputJS: 'js/reveal.js',
inputCSS: 'css/reveal.css',
outputJS: 'js/reveal.min.js',
outputCSS: 'css/reveal.min.css',
meta: { meta: {
version: '2.3',
banner: banner:
'/*!\n' + '/*!\n' +
' * reveal.js <%= meta.version %> (<%= grunt.template.today("yyyy-mm-dd, HH:MM") %>)\n' + ' * reveal.js <%= pkg.version %> (<%= grunt.template.today("yyyy-mm-dd, HH:MM") %>)\n' +
' * http://lab.hakim.se/reveal-js\n' + ' * http://lab.hakim.se/reveal-js\n' +
' * MIT licensed\n' + ' * MIT licensed\n' +
' *\n' + ' *\n' +
@ -23,8 +15,8 @@ module.exports = function(grunt) {
' */' ' */'
}, },
lint: { jshint: {
files: [ 'grunt.js', '<%= inputJS %>' ] files: [ 'gruntfile.js', 'js/reveal.js' ]
}, },
// Tests will be added soon // Tests will be added soon
@ -32,17 +24,20 @@ module.exports = function(grunt) {
files: [ 'test/**/*.html' ] files: [ 'test/**/*.html' ]
}, },
min: { uglify: {
dist: { options: {
src: [ '<banner:meta.banner>', '<%= inputJS %>' ], banner: '<%= meta.banner %> \n'
dest: '<%= outputJS %>' },
} build: {
src: 'js/reveal.js',
dest: 'js/reveal.min.js'
}
}, },
mincss: { cssmin: {
compress: { compress: {
files: { files: {
'<%= outputCSS %>': [ '<%= inputCSS %>' ] 'css/reveal.min.css': [ 'css/reveal.css' ]
} }
} }
}, },
@ -69,16 +64,20 @@ module.exports = function(grunt) {
}, },
watch: { watch: {
files: [ 'grunt.js', '<%= inputJS %>', '<%= inputCSS %>' ], files: [ 'gruntfile.js', 'js/reveal.js', 'css/reveal.css' ],
tasks: 'default' tasks: 'default'
} }
}); });
// Dependencies // Dependencies
grunt.loadNpmTasks( 'grunt-contrib-mincss' ); grunt.loadNpmTasks( 'grunt-contrib-jshint' );
grunt.loadNpmTasks( 'grunt-contrib-cssmin' );
grunt.loadNpmTasks( 'grunt-contrib-uglify' );
grunt.loadNpmTasks( 'grunt-contrib-watch' );
// Default task // Default task
grunt.registerTask( 'default', [ 'lint', 'mincss', 'min' ] ); grunt.registerTask( 'default', [ 'jshint', 'cssmin', 'uglify' ] );
}; };

View File

@ -1,31 +1,34 @@
{ {
"name": "reveal.js", "name": "reveal.js",
"version": "2.3.0", "version": "2.3.0",
"description": "The HTML Presentation Framework", "description": "The HTML Presentation Framework",
"homepage": "http://lab.hakim.se/reveal-js", "homepage": "http://lab.hakim.se/reveal-js",
"author": { "author": {
"name": "Hakim El Hattab", "name": "Hakim El Hattab",
"email": "hakim.elhattab@gmail.com", "email": "hakim.elhattab@gmail.com",
"web": "http://hakim.se" "web": "http://hakim.se"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git://github.com/hakimel/reveal.js.git" "url": "git://github.com/hakimel/reveal.js.git"
}, },
"engines": { "engines": {
"node": "~0.8.0" "node": "~0.8.0"
}, },
"scripts": { "scripts": {
"test": "grunt lint qunit" "test": "grunt lint qunit"
}, },
"dependencies": { "dependencies": {
"underscore" : "~1.3.3", "underscore": "~1.3.3",
"express" : "~2.5.9", "express": "~2.5.9",
"socket.io" : "~0.9.6", "socket.io": "~0.9.6",
"mustache" : "~0.4.0" "mustache": "~0.4.0"
}, },
"devDependencies": { "devDependencies": {
"grunt-contrib-mincss": "~0.3.1", "grunt-contrib-jshint": "~0.2.0",
"grunt": "~0.3.17" "grunt-contrib-cssmin": "~0.4.1",
} "grunt-contrib-uglify": "~0.1.1",
"grunt-contrib-watch": "~0.2.0",
"grunt": "~0.4.0"
}
} }