Skip to content

Commit fb70a7b

Browse files
authored
feat: generate es-module distribution (#686)
1 parent e6e0bd0 commit fb70a7b

File tree

5 files changed

+32
-5
lines changed

5 files changed

+32
-5
lines changed

smithy-typescript-ssdk-libs/server-apigateway/package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@
33
"version": "1.0.0-alpha.7",
44
"description": "Base components for Smithy services behind APIGateway",
55
"main": "./dist/cjs/index.js",
6+
"module": "./dist/es/index.js",
67
"types": "./dist/types/index.d.ts",
78
"scripts": {
89
"prepublishOnly": "yarn build",
910
"pretest": "yarn build",
10-
"build": "tsc -p tsconfig.json",
11+
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
12+
"build:cjs": "tsc -p tsconfig.cjs.json",
13+
"build:es": "tsc -p tsconfig.es.json",
14+
"build:types": "tsc -p tsconfig.types.json",
1115
"postbuild": "rimraf dist/types/ts3.4 && downlevel-dts dist/types dist/types/ts3.4",
1216
"test": "jest --passWithNoTests",
1317
"clean": "rimraf dist",
@@ -30,6 +34,7 @@
3034
"devDependencies": {
3135
"@types/jest": "^26.0.4",
3236
"@types/node": "^14.14.37",
37+
"concurrently": "^7.6.0",
3338
"downlevel-dts": "^0.7.0",
3439
"jest": "^26.1.0",
3540
"typescript": "~4.2.2",
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": "./tsconfig",
3+
"compilerOptions": {
4+
"outDir": "dist/cjs"
5+
}
6+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "./tsconfig",
3+
"compilerOptions": {
4+
"module": "esnext",
5+
"outDir": "dist/es"
6+
}
7+
}
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
{
2+
"extends": "../tsconfig.json",
23
"compilerOptions": {
34
"stripInternal": true,
4-
"declarationDir": "./dist/types",
5-
"rootDir": "./src",
6-
"outDir": "./dist/cjs",
5+
"removeComments": true,
6+
"rootDir": "src",
77
"baseUrl": "."
88
},
9-
"extends": "../tsconfig.json",
109
"include": ["src/"]
1110
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"extends": "./tsconfig",
3+
"compilerOptions": {
4+
"removeComments": false,
5+
"declaration": true,
6+
"declarationDir": "dist/types",
7+
"emitDeclarationOnly": true
8+
},
9+
"exclude": ["test/**/*", "dist/types/**/*"]
10+
}

0 commit comments

Comments
 (0)