From 2b0b50ad762972e4d77b13498cd11d7ca80621a3 Mon Sep 17 00:00:00 2001 From: Ben Drucker Date: Sun, 22 Feb 2015 11:44:13 -0500 Subject: [PATCH] chore(package.json): add commonjs support See https://github.com/angular/angular.js/pull/10732 Closes #14 --- README.md | 11 +---------- index.js | 2 ++ package.json | 2 +- 3 files changed, 4 insertions(+), 11 deletions(-) create mode 100644 index.js diff --git a/README.md b/README.md index b09e0a7b..25c6094f 100644 --- a/README.md +++ b/README.md @@ -14,21 +14,12 @@ You can install this package either with `npm` or with `bower`. npm install angular-resource ``` -Add a ` -``` - Then add `ngResource` as a dependency for your app: ```javascript -angular.module('myApp', ['ngResource']); +angular.module('myApp', [require('angular-resource')]); ``` -Note that this package is not in CommonJS format, so doing `require('angular-resource')` will -return `undefined`. - ### bower ```shell diff --git a/index.js b/index.js new file mode 100644 index 00000000..fc401529 --- /dev/null +++ b/index.js @@ -0,0 +1,2 @@ +require('./angular-resource'); +module.exports = 'ngResource'; diff --git a/package.json b/package.json index 3b046a7a..020f025e 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "angular-resource", "version": "1.3.14-build.55+sha.0cf170d", "description": "AngularJS module for interacting with RESTful server-side data sources", - "main": "angular-resource.js", + "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" },