Skip to content
This repository was archived by the owner on Nov 10, 2022. It is now read-only.

Commit 28b9a9a

Browse files
committed
Add ESM build
1 parent 504041a commit 28b9a9a

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

package.json

+7-2
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,20 @@
33
"version": "1.0.0-rc.0",
44
"description": "Public API for OpenTelemetry",
55
"main": "build/src/index.js",
6+
"module": "build/lib/index.js",
67
"types": "build/src/index.d.ts",
78
"browser": {
89
"./src/platform/index.ts": "./src/platform/browser/index.ts",
10+
"./build/lib/platform/index.js": "./build/lib/platform/browser/index.js",
911
"./build/src/platform/index.js": "./build/src/platform/browser/index.js"
1012
},
1113
"repository": "https://github.com/open-telemetry/opentelemetry-js-api.git",
1214
"scripts": {
1315
"build": "npm run compile",
14-
"clean": "tsc --build --clean",
16+
"clean": "tsc --build --clean tsconfig.json tsconfig.esm.json",
1517
"codecov:browser": "nyc report --reporter=json && codecov -f coverage/*.json -p .",
1618
"codecov": "nyc report --reporter=json && codecov -f coverage/*.json -p .",
17-
"compile": "tsc --build",
19+
"compile": "tsc --build tsconfig.json tsconfig.esm.json",
1820
"docs": "typedoc",
1921
"docs:deploy": "gh-pages --dist docs/out",
2022
"docs:test": "linkinator docs/out --silent --skip david-dm.org",
@@ -40,6 +42,9 @@
4042
"node": ">=8.0.0"
4143
},
4244
"files": [
45+
"build/lib/**/*.js",
46+
"build/lib/**/*.js.map",
47+
"build/lib/**/*.d.ts",
4348
"build/src/**/*.js",
4449
"build/src/**/*.js.map",
4550
"build/src/**/*.d.ts",

tsconfig.esm.json

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"module": "ES6",
5+
"moduleResolution": "node",
6+
"outDir": "build/lib",
7+
"rootDir": "src",
8+
"tsBuildInfoFile": "build/lib/tsconfig.esm.tsbuildinfo"
9+
},
10+
"include": [
11+
"src/**/*.ts"
12+
],
13+
}

0 commit comments

Comments
 (0)