Skip to content

Commit 324a888

Browse files
committed
Remove ESM build
1 parent e6f0ca5 commit 324a888

File tree

8 files changed

+17
-30
lines changed

8 files changed

+17
-30
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77

88
## [Unreleased]
99

10+
### Removed
11+
12+
* Removed ES modules build
13+
14+
This should solve compatibility problems with `es6-error`. The cjs
15+
build now should also work with emulated ES module imports.
16+
1017
### Changed
1118

1219
* Use `cpy-cli` for build process

package.json

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,27 +30,15 @@
3030
"rest"
3131
],
3232
"main": "lib/cjs/index.js",
33-
"module": "lib/esm/index.js",
34-
"typings": "lib/esm/arangojs.d.ts",
33+
"typings": "lib/cjs/arangojs.d.ts",
3534
"browser": {
3635
"./lib/cjs/util/btoa.js": "./lib/cjs/util/btoa.web.js",
3736
"./lib/cjs/util/bytelength.js": "./lib/cjs/util/bytelength.web.js",
3837
"./lib/cjs/util/joinPath.js": "./lib/cjs/util/joinPath.web.js",
3938
"./lib/cjs/util/multipart.js": "./lib/cjs/util/multipart.web.js",
40-
"./lib/cjs/util/request.js": "./lib/cjs/util/request.web.js",
41-
"./lib/esm/util/btoa.js": "./lib/esm/util/btoa.web.js",
42-
"./lib/esm/util/bytelength.js": "./lib/esm/util/bytelength.web.js",
43-
"./lib/esm/util/joinPath.js": "./lib/esm/util/joinPath.web.js",
44-
"./lib/esm/util/multipart.js": "./lib/esm/util/multipart.web.js",
45-
"./lib/esm/util/request.js": "./lib/esm/util/request.web.js"
39+
"./lib/cjs/util/request.js": "./lib/cjs/util/request.web.js"
4640
},
47-
"files": [
48-
"lib/web.*",
49-
"lib/cjs/*.*",
50-
"lib/esm/*.*",
51-
"lib/cjs/util/*.*",
52-
"lib/esm/util/*.*"
53-
],
41+
"files": ["lib/web.*", "lib/cjs/*.*", "lib/cjs/util/*.*"],
5442
"scripts": {
5543
"test":
5644
"mocha --growl --reporter spec --require source-map-support/register --require core-js/shim --timeout 10000 lib/cjs/test",
@@ -59,10 +47,7 @@
5947
"mocha --reporter spec --require source-map-support/register --require core-js/shim --timeout 10000 lib/cjs/test",
6048
"preci": "yarn install",
6149
"jenkins": "yarn ci -- --timeout 0 --reporter xunit-file",
62-
"dist:cjs":
63-
"tsc -p . --outDir ./lib/cjs/ --module commonjs && cpy src/index.cjs.js --rename=index.js lib/cjs/",
64-
"dist:esm":
65-
"tsc -p . --outDir ./lib/esm/ --module es2015 && cpy src/index.esm.js --rename=index.js lib/esm/",
50+
"dist:cjs": "tsc -p . --outDir ./lib/cjs/ && cpy src/index.js lib/cjs/",
6651
"dist:web": "webpack",
6752
"dist": "rimraf lib && npm-run-all --parallel dist:*",
6853
"prepublish": "yarn dist && node -e 'require(\".\");'"

src/arangojs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ export default function arangojs(config: Config) {
66
return new Database(config);
77
}
88

9-
Object.assign(arangojs, { Database, aql });
9+
Object.assign(arangojs, { Database, aql, default: arangojs });
1010
export { Database, aql };

src/index.cjs.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/index.esm.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
"use strict";
2+
module.exports = require("./arangojs").default;
3+
Object.defineProperty(module.exports, "__esModule", { value: true });

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"sourceMap": true,
99
"inlineSources": true,
1010
"lib": ["dom", "es2015", "es2016", "es2017"],
11-
"module": "esnext",
11+
"module": "commonjs",
1212
"moduleResolution": "node",
1313
"noEmit": false,
1414
"noFallthroughCasesInSwitch": true,

webpack.config.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@ var resolve = require("path").resolve;
33
var webpack = require("webpack");
44

55
module.exports = {
6-
entry: [
7-
"regenerator-runtime/runtime",
8-
resolve(__dirname, "src/index.cjs.js")
9-
],
6+
entry: ["regenerator-runtime/runtime", resolve(__dirname, "src/index.js")],
107
devtool: "source-map",
118
output: {
129
path: resolve(__dirname, "lib"),

0 commit comments

Comments
 (0)