Skip to content

Commit

Permalink
build(tsconfig): emit esm output
Browse files Browse the repository at this point in the history
  • Loading branch information
kwonoj committed Nov 11, 2020
1 parent 38930e0 commit 59c748b
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 7 deletions.
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
"name": "tslog",
"version": "2.11.0",
"description": "📝 Expressive TypeScript Logger for Node.js: Pretty errors, stack traces, code frames, and JSON output to attachable transports.",
"main": "dist/index",
"typings": "dist/index",
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
"types": "./dist/types/index.d.ts",
"engines": {
"node": ">=10"
},
Expand All @@ -12,7 +13,7 @@
"ts-node-onchange": "onchange -i \"**/*.ts\" -- npm run ts-node",
"start-ts": "npm run ts-node",
"start": "node dist/example/index.js",
"build": "tsc",
"build": "tsc -b tsconfig.json tsconfig.esm.json tsconfig.types.json",
"prepublishOnly": "npm run build && npm run test",
"eslint": "eslint . --ext .ts",
"eslint-fix": "eslint . --ext .ts --fix",
Expand Down Expand Up @@ -80,7 +81,8 @@
"source-map-support": "^0.5.19"
},
"files": [
"dist"
"dist",
"src"
],
"keywords": [
"logger",
Expand Down
7 changes: 7 additions & 0 deletions tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "esnext",
"outDir": "dist/esm"
}
}
4 changes: 1 addition & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": true,
"declaration": true,
"declarationMap": true,
"strict": true,
"suppressImplicitAnyIndexErrors": true,
"allowSyntheticDefaultImports": true,
"outDir": "dist"
"outDir": "dist/cjs"
},
"include": [
"src/*.ts",
Expand Down
12 changes: 12 additions & 0 deletions tsconfig.types.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "esnext",
"target": "es2015",
"removeComments": false,
"declaration": true,
"declarationMap": true,
"declarationDir": "dist/types",
"emitDeclarationOnly": true
}
}

0 comments on commit 59c748b

Please sign in to comment.