Skip to content

Commit

Permalink
fix: add shims for browser (#316)
Browse files Browse the repository at this point in the history
* fix: add shims for browser and change the sts expire time of example project
* chore: add 'ali-oss'  dependencies for example project
* chore: include dist directory for browser build
  • Loading branch information
PeterRao authored and fengmk2 committed Dec 21, 2017
1 parent 060df98 commit 12a4271
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion example/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// require("babel-polyfill")

var $ = require('jquery');
var OSS = require('..');
var OSS = require('ali-oss');

var appServer = '/sts';
var bucket = '<bucket-name>';
Expand Down
1 change: 1 addition & 0 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
},
"homepage": "https://github.com/rockuw/oss-in-browser#readme",
"dependencies": {
"ali-oss": "^4.11.2",
"babel-polyfill": "^6.26.0",
"co": "^4.6.0",
"express": "^4.16.2",
Expand Down
3 changes: 2 additions & 1 deletion example/server/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module.exports = {
AccessKeyId: env.ALI_SDK_STS_ID,
AccessKeySecret: env.ALI_SDK_STS_SECRET,
RoleArn: env.ALI_SDK_STS_ROLE,
TokenExpireTime : "900",
//建议 Token 失效时间为 1 小时
TokenExpireTime: "3600",
PolicyFile: "policy/all_policy.txt"
}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
"main": "lib/client.js",
"files": [
"lib",
"shims"
"shims",
"dist"
],
"browser": {
"lib/client.js": "./lib/browser.js",
"mime": "./shims/mime.js",
"urllib": "./shims/xhr.js",
"utility": "./shims/utility.js",
"crypto": "./shims/crypto.js",
"fs": false,
"child_process": false
},
Expand Down

0 comments on commit 12a4271

Please sign in to comment.