Skip to content

Commit

Permalink
fix issues with resolve JSON module by specifying rootdir and entry (#40
Browse files Browse the repository at this point in the history
)
  • Loading branch information
kelvin-lu authored Oct 1, 2020
1 parent f3fabb0 commit 9e9a952
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 15 deletions.
6 changes: 3 additions & 3 deletions packages/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"engines": {
"node": ">=10"
},
"main": "dist/index.js",
"module": "esm/index.js",
"types": "dist/index.d.ts",
"main": "dist/src/index.js",
"module": "esm/src/index.js",
"types": "dist/src/index.d.ts",
"publishConfig": {
"access": "public"
},
Expand Down
5 changes: 1 addition & 4 deletions packages/node/src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import { Options, LogLevel } from '@amplitude/types';
// constants related to this instance of the SDK
// TODO(Kelvin): Why did this break typescript compilation?
// export { version as SDK_VERSION } from '../package.json';
export const SDK_VERSION = '1.0.1';
export { version as SDK_VERSION } from '../package.json';
export const SDK_NAME = 'amplitude-node';
export const AMPLITUDE_SERVER_URL = 'https://api2.amplitude.com/2/httpapi';
export const BASE_RETRY_TIMEOUT = 100;
Expand Down
1 change: 1 addition & 0 deletions packages/node/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": ".",
"baseUrl": ".",
"outDir": "dist"
},
Expand Down
1 change: 1 addition & 0 deletions packages/node/tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "../../tsconfig.esm.json",
"compilerOptions": {
"rootDir": ".",
"baseUrl": ".",
"outDir": "esm"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"engines": {
"node": ">=10"
},
"main": "dist/index.js",
"module": "esm/index.js",
"types": "dist/index.d.ts",
"main": "dist/src/index.js",
"module": "esm/src/index.js",
"types": "dist/src/index.d.ts",
"publishConfig": {
"access": "public"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/types/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"compilerOptions": {
"baseUrl": ".",
"outDir": "dist",
"rootDir": "src"
"rootDir": "."
},
"include": ["src/**/*.ts"]
}
1 change: 1 addition & 0 deletions packages/types/tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "../../tsconfig.esm.json",
"compilerOptions": {
"rootDir": ".",
"baseUrl": ".",
"outDir": "esm"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"engines": {
"node": ">=10"
},
"main": "dist/index.js",
"module": "esm/index.js",
"types": "dist/index.d.ts",
"main": "dist/src/index.js",
"module": "esm/src/index.js",
"types": "dist/src/index.d.ts",
"publishConfig": {
"access": "public"
},
Expand Down
1 change: 1 addition & 0 deletions packages/utils/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": ".",
"baseUrl": ".",
"outDir": "dist"
},
Expand Down
1 change: 1 addition & 0 deletions packages/utils/tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "../../tsconfig.esm.json",
"compilerOptions": {
"rootDir": ".",
"baseUrl": ".",
"outDir": "esm"
},
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"types": ["node"],
"paths": {
"@amplitude/*": ["*/src"]
}
},
"resolveJsonModule": true
}
}

0 comments on commit 9e9a952

Please sign in to comment.