Skip to content

Commit fd4df2a

Browse files
committed
feat: Add esm for node
Fixes getsentry#1963
1 parent b8691d3 commit fd4df2a

File tree

6 files changed

+20
-9
lines changed

6 files changed

+20
-9
lines changed

packages/core/tsconfig.build.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
"extends": "../../tsconfig.json",
33
"compilerOptions": {
44
"baseUrl": ".",
5-
"outDir": "dist",
6-
"rootDir": "src"
5+
"outDir": "dist"
76
},
8-
"include": ["src/**/*.ts"]
7+
"include": ["src/**/*"]
98
}

packages/node/.npmignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
*
22
!/dist/**/*
3+
!/esm/**/*

packages/node/package.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,12 @@
3939
"typescript": "^3.3.3333"
4040
},
4141
"scripts": {
42-
"build": "tsc -p tsconfig.build.json",
43-
"build:watch": "tsc -p tsconfig.build.json -w --preserveWatchOutput",
42+
"build": "run-p build:es5 build:esm",
43+
"build:es5": "tsc -p tsconfig.build.json",
44+
"build:esm": "tsc -p tsconfig.esm.json",
45+
"build:watch": "run-p build:watch:es5 build:watch:esm",
46+
"build:watch:es5": "tsc -p tsconfig.build.json -w --preserveWatchOutput",
47+
"build:watch:esm": "tsc -p tsconfig.esm.json -w --preserveWatchOutput",
4448
"clean": "rimraf dist coverage",
4549
"link:yarn": "yarn link",
4650
"lint": "run-s lint:prettier lint:tslint",

packages/node/src/integrations/linkederrors.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export class LinkedErrors implements Integration {
5959

6060
return new SyncPromise<Event | null>(resolve => {
6161
this.walkErrorTree(hint.originalException as ExtendedError, this._key).then((linkedErrors: Exception[]) => {
62-
if (event && event.exception) {
62+
if (event && event.exception && event.exception.values) {
6363
event.exception.values = [...linkedErrors, ...event.exception.values];
6464
}
6565
resolve(event);

packages/node/tsconfig.build.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
"extends": "../../tsconfig.json",
33
"compilerOptions": {
44
"baseUrl": ".",
5-
"outDir": "dist",
6-
"rootDir": "src"
5+
"outDir": "dist"
76
},
8-
"include": ["src/**/*.ts"]
7+
"include": ["src/**/*"]
98
}

packages/node/tsconfig.esm.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "../../tsconfig.esm.json",
3+
"compilerOptions": {
4+
"baseUrl": ".",
5+
"outDir": "esm"
6+
},
7+
"include": ["src/**/*"]
8+
}

0 commit comments

Comments
 (0)