Browse Source

Add a umd wrapper for commonjs and amd support

pull/43/head
Will Binns-Smith 11 years ago
parent
commit
542a66da21
  1. 7
      Gruntfile.js
  2. 2
      package.json
  3. 3
      src/echo.js

7
Gruntfile.js

@ -54,6 +54,12 @@ module.exports = function (grunt) {
banner: '<%= tag.banner %>'
}
},
umd: {
dist: {
src: 'dist/<%= project.name %>.js',
objectToExport: 'echo'
}
},
uglify: {
files: {
src: ['dist/<%= project.name %>.js'],
@ -88,6 +94,7 @@ module.exports = function (grunt) {
grunt.registerTask('default' , [
'jshint',
'concat:dist',
'umd:dist',
'uglify',
// 'connect:livereload',
// 'open',

2
package.json

@ -1,6 +1,7 @@
{
"name": "Echo",
"version": "1.5.0",
"main": "dist/echo.js",
"homepage": "https://github.com/toddmotto/echo",
"author": "Todd Motto",
"description": "Lazy-loading with data-* attributes, offset and throttle options",
@ -26,6 +27,7 @@
"grunt-contrib-watch": "~0.4.4",
"connect-livereload": "~0.2.0",
"grunt-open": "~0.2.0",
"grunt-umd": "^1.7.3",
"matchdep": "~0.1.2"
},
"peerDependencies": {

3
src/echo.js

@ -1,4 +1,5 @@
window.Echo = (function (global, document, undefined) {
/* exported echo */
var echo = (function (global, document, undefined) {
'use strict';

Loading…
Cancel
Save