Skip to content

Commit 9b70555

Browse files
committed
Expose native async build
1 parent 982f802 commit 9b70555

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,17 @@
2929
"http",
3030
"rest"
3131
],
32-
"main": "lib/cjs/index.js",
32+
"main": "lib/index.js",
3333
"typings": "lib/cjs/arangojs.d.ts",
3434
"browser": {
35+
"./lib/index.js": "./lib/cjs/index.js",
3536
"./lib/cjs/util/btoa.js": "./lib/cjs/util/btoa.web.js",
3637
"./lib/cjs/util/bytelength.js": "./lib/cjs/util/bytelength.web.js",
3738
"./lib/cjs/util/joinPath.js": "./lib/cjs/util/joinPath.web.js",
3839
"./lib/cjs/util/multipart.js": "./lib/cjs/util/multipart.web.js",
3940
"./lib/cjs/util/request.js": "./lib/cjs/util/request.web.js"
4041
},
41-
"files": ["lib/web.*", "lib/cjs/*.*", "lib/cjs/util/*.*"],
42+
"files": ["lib/*.*", "lib/cjs/*.*", "lib/cjs/util/*.*"],
4243
"scripts": {
4344
"test":
4445
"mocha --growl --reporter spec --require source-map-support/register --require core-js/shim --timeout 10000 lib/cjs/test",
@@ -48,8 +49,11 @@
4849
"preci": "yarn install",
4950
"jenkins": "yarn ci -- --timeout 0 --reporter xunit-file",
5051
"dist:cjs": "tsc -p . --outDir ./lib/cjs/ && cpy src/index.js lib/cjs/",
52+
"dist:async":
53+
"tsc -p . --outDir ./lib/async/ --target es2017 && cpy src/index.js lib/async/",
5154
"dist:web": "webpack",
52-
"dist": "rimraf lib && npm-run-all --parallel dist:*",
55+
"dist":
56+
"rimraf lib && npm-run-all --parallel dist:* && cpy src/index.all.js --rename index.js lib/",
5357
"prepublish": "yarn dist && node -e 'require(\".\");'"
5458
},
5559
"dependencies": {

src/index.all.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
try {
2+
module.exports = require("./async");
3+
} catch (e) {
4+
module.exports = require("./cjs");
5+
}

0 commit comments

Comments
 (0)