Skip to content

Commit

Permalink
grunt setup for minification. Add minified version. Closes #16
Browse files Browse the repository at this point in the history
  • Loading branch information
ahaith committed Feb 4, 2015
1 parent 65cd9ae commit 98c2f5e
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.env
docs/build
node_modules
30 changes: 30 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*global module:false*/
module.exports = function(grunt) {

// Project configuration.
grunt.initConfig({
// Metadata.
pkg: grunt.file.readJSON('package.json'),
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'https://github.com/ox-it/talks.ox-js-widget\n',
// Task configuration.
uglify: {
options: {
banner: '<%= banner %>'
},
dist: {
src: 'widget/embed_ox_talks.js',
dest: 'widget/embed_ox_talks.min.js'
}
},
});

// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-uglify');

// Default task.
grunt.registerTask('minify', ['uglify']);
grunt.registerTask('default', ['uglify']);

};
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,21 @@
[![Documentation Status](https://readthedocs.org/projects/talksox-js-widget/badge/?version=latest)](https://readthedocs.org/projects/talksox-js-widget/?badge=latest)

Javascript widget for embedding talks information from talks.ox

## Developer

N.B. The node package file is used only for development dependencies. It is up to the user to ensure that a comaptible version of jQuery is loaded. If the calendar functionality is required, it's also necessary to include a version of moment.js and fullcalendar.js/css.

### Dev dependencies

Assuming the node package manager is available, install the dev dependencies by running the following command from the root directory:

npm install

Grunt and other dependencies should now be available

### Minify

A new version of embed_ox_talks.min.js can be generated via:

grunt minify
10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"engines": {
"node": ">= 0.10.0"
},
"devDependencies": {
"grunt": "~0.4.5",
"grunt-contrib-uglify": "^0.7.0"
},
"dependencies": {}
}
3 changes: 3 additions & 0 deletions widget/embed_ox_talks.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 98c2f5e

Please sign in to comment.