Skip to content

Commit 055a89f

Browse files
committed
Build parse from npm script rather than including it in the repo
1 parent 91681eb commit 055a89f

File tree

6 files changed

+15
-782
lines changed

6 files changed

+15
-782
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ logs
2222
results
2323

2424
node_modules
25+
parse.js

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,19 @@ $ npm install pusher
1212

1313
### Parse Cloud
1414

15-
In order to use the library in a Parse Cloud module, download the file in `parse_cloud/pusher.js` into your `cloud/modules` path.
15+
In order to use the library in a Parse Cloud module, install the module into your `cloud/modules` path:
16+
17+
$ npm install pusher --prefix cloud/modules
18+
19+
Then to build the file bundle for Parse Cloud:
20+
21+
$ cd cloud/modules/pusher
22+
$ npm run parse-build
1623

1724
To import `Pusher`:
1825

1926
```js
20-
var Pusher = require('cloud/modules/pusher');
27+
var Pusher = require('cloud/modules/node_modules/pusher/parse');
2128
```
2229

2330
## Configuration

lib/parse_cloud/request.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ module.exports = ParseRequest = {
3333
},
3434

3535
forever: function(){
36-
console.log("This Parse extension does not support keep-alive. " +
36+
console.log("This Parse extension does not support keep-alive." +
3737
" Falling back to default...");
3838
return this;
3939
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
"webpack": "^1.12.9"
3636
},
3737
"scripts": {
38-
"test": "node node_modules/.bin/mocha tests/integration/**/*.js"
38+
"test": "node node_modules/.bin/mocha tests/integration/**/*.js",
39+
"parse-build": "echo 'Creating build for Parse Cloud.' && node ./node_modules/.bin/webpack --config=./parse.webpack.js"
3940
},
4041
"keywords": ["pusher", "websockets", "realtime"],
4142
"license": "MIT",

parse.webpack.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ module.exports = {
88
entry: "./lib/pusher",
99
output: {
1010
library: "Pusher",
11-
path: path.join(__dirname, "./parse_cloud"),
11+
path: __dirname,
1212
libraryTarget: "commonjs2",
13-
filename: "pusher.js"
13+
filename: "parse.js"
1414
},
1515
target: "node",
1616
resolve: {

0 commit comments

Comments
 (0)