Skip to content

Commit

Permalink
CommonJS export for npm / browserify
Browse files Browse the repository at this point in the history
better dep versions in bower.json
add proper package.json dependencies
tick version v1.1.1
  • Loading branch information
desandro committed Oct 17, 2014
1 parent 031a90e commit bca3f07
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 13 deletions.
4 changes: 3 additions & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
"undef": true,
"unused": true,
"predef": {
"define": false
"define": false,
"module": false,
"require": false
}
}
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ Grab a packaged source file:
+ [draggabilly.pkgd.min.js](http://draggabilly.desandro.com/draggabilly.pkgd.min.js) for production
+ [draggabilly.pkgd.js](http://draggabilly.desandro.com/draggabilly.pkgd.js) for development

Or if you're cool with the command line, install with [Bower](http://bower.io).
Install with [Bower](http://bower.io): `bower install draggabilly`

``` bash
bower install draggabilly
```
Install with npm: `npm install draggabilly`

## Usage

Expand Down
10 changes: 5 additions & 5 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "draggabilly",
"main": "draggabilly.js",
"version": "1.1.0",
"version": "1.1.1",
"description": "make that shiz draggable",
"dependencies": {
"classie": "desandro/classie",
"classie": "^1",
"eventEmitter": ">=3 <5",
"eventie": "desandro/eventie",
"get-size": "desandro/get-size#>=1.1.4 <2",
"get-style-property": "desandro/get-style-property"
"eventie": "^1",
"get-size": ">=1.1.4 <2",
"get-style-property": "^1"
},
"ignore": [
"**/.*",
Expand Down
11 changes: 10 additions & 1 deletion draggabilly.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Draggabilly v1.1.0
* Draggabilly v1.1.1
* Make that shiz draggable
* http://draggabilly.desandro.com
* MIT license
Expand Down Expand Up @@ -592,6 +592,15 @@ if ( typeof define === 'function' && define.amd ) {
'get-size/get-size'
],
draggabillyDefinition );
} else if ( typeof exports === 'object' ) {
// CommonJS
module.exports = draggabillyDefinition(
require('desandro-classie'),
require('wolfy87-eventemitter'),
require('eventie'),
require('desandro-get-style-property'),
require('get-size')
);
} else {
// browser global
window.Draggabilly = draggabillyDefinition(
Expand Down
12 changes: 10 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
{
"name": "draggabilly",
"version": "1.1.0",
"version": "1.1.1",
"description": "make that shiz draggable",
"main": "draggabilly.js",
"dependencies": {},
"dependencies": {
"desandro-classie": "^1",
"wolfy87-eventemitter": ">=3 <5",
"eventie": "^1",
"get-size": ">=1.1.4 <2",
"desandro-get-style-property": "^1"
},
"devDependencies": {
"grunt": "^0.4.5",
"grunt-contrib-jshint": "^0.10.0",
Expand All @@ -15,6 +21,8 @@
"url": "git://github.com/desandro/draggabilly.git"
},
"keywords": [
"DOM",
"drag",
"draggable",
"touch",
"multitouch"
Expand Down

0 comments on commit bca3f07

Please sign in to comment.