Skip to content

Commit de0156f

Browse files
committed
feat: support weapp game
1 parent b5b8313 commit de0156f

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
"debug": "^3.1.0",
2525
"es6-promise": "^4.0.5",
2626
"eventemitter3": "^2.0.3",
27-
"leancloud-realtime": "^3.5.0",
28-
"leancloud-realtime-plugin-live-query": "^1.0.0",
27+
"leancloud-realtime": "^4.0.0-beta.2",
28+
"leancloud-realtime-plugin-live-query": "^1.1.0",
2929
"localstorage-memory": "^1.0.1",
3030
"md5": "^2.0.0",
3131
"superagent": "^3.3.1",
@@ -55,7 +55,7 @@
5555
"qiniu": "^6.1.11",
5656
"should": "^11.1.0",
5757
"typescript": "^2.4.1",
58-
"weapp-polyfill": "^2.0.1",
58+
"weapp-polyfill": "^3.1.2",
5959
"webpack": "^2.2.0-rc.3",
6060
"webpack-strip-block": "^0.2.0"
6161
},

src/init.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ AV.init = function init(options, ...params) {
103103
} else if (AV._sharedConfig.liveQueryRealtime) {
104104
AV._config.realtime = new AV._sharedConfig.liveQueryRealtime({
105105
appId,
106+
appKey,
106107
region,
107108
});
108109
}

webpack/weapp.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const webpack = require('webpack');
12
const { create, entry, name } = require('./common');
23

34
const config = create();
@@ -7,5 +8,9 @@ config.entry = {
78
[`${name}-weapp-min`]: entry,
89
};
910
config.resolve.aliasFields = ['weapp', 'browser'];
11+
config.plugins.push(new webpack.BannerPlugin({
12+
banner: 'var window={};var XMLHttpRequest;',
13+
raw: true,
14+
}));
1015

1116
module.exports = config;

0 commit comments

Comments
 (0)