diff --git a/package.json b/package.json index 1dd84af6cf..9404b7a248 100644 --- a/package.json +++ b/package.json @@ -3,19 +3,20 @@ "version": "0.16.0", "description": "OpenTelemetry AWS Xray propagator provides context propagation for systems that are using AWS X-Ray format.", "main": "build/src/index.js", + "module": "build/esm/index.js", "types": "build/src/index.d.ts", "repository": "open-telemetry/opentelemetry-js-contrib", "scripts": { "precompile": "tsc --version", - "compile": "tsc --build", - "clean": "tsc --build --clean", + "compile": "tsc --build tsconfig.json tsconfig.esm.json", + "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json", "test": "nyc ts-mocha -p tsconfig.json test/**/*.test.ts", "test:browser": "nyc karma start --single-run", "codecov": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "version": "node ../../scripts/version-update.js", - "watch": "tsc --build --watch", + "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json", "prepare": "npm run compile" }, "keywords": [ @@ -31,6 +32,9 @@ "node": ">=8.0.0" }, "files": [ + "build/esm/**/*.js", + "build/esm/**/*.js.map", + "build/esm/**/*.d.ts", "build/src/**/*.js", "build/src/**/*.js.map", "build/src/**/*.d.ts", diff --git a/tsconfig.esm.json b/tsconfig.esm.json new file mode 100644 index 0000000000..a94adff6aa --- /dev/null +++ b/tsconfig.esm.json @@ -0,0 +1,11 @@ +{ + "extends": "../../tsconfig.base.esm.json", + "compilerOptions": { + "rootDir": "src", + "outDir": "build/esm", + "tsBuildInfoFile": "build/esm/tsconfig.esm.tsbuildinfo" + }, + "include": [ + "src/**/*.ts" + ] +}