Skip to content

Commit

Permalink
feat(esm): simplify tsconfig.json
Browse files Browse the repository at this point in the history
  • Loading branch information
tduyng committed Apr 2, 2023
1 parent b1cfdec commit 7871639
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion ava.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default {
require: ['ts-node/register/transpile-only'],
require: ['ts-node/register'],
extensions: ['js', 'ts'],
files: ['test/**/*.test.{js,ts}'],
nodeArguments: ['--experimental-specifier-resolution=node', '--loader=ts-node/esm', '--no-warnings'],
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@
"scripts": {
"fmt": "prettier --color --write \"{*,src/**/*,test/**/*}.{js,ts}\" --cache",
"check-fmt": "prettier --list-different \"{*,test/**/*}.{js,ts}\"",
"build-cjs": "node scripts/esbuild-cjs.js && tsc -p ./tsconfig.lib.json --declaration --emitDeclarationOnly --declarationDir lib/cjs && node scripts/casting.js",
"build-esm": "node scripts/esbuild-esm.js && tsc -p ./tsconfig.lib.json --declaration --emitDeclarationOnly --declarationDir lib/esm",
"build-cjs": "node scripts/esbuild-cjs.js && tsc -p ./tsconfig.lib.json --declarationDir lib/cjs && node scripts/casting.js",
"build-esm": "node scripts/esbuild-esm.js && tsc -p ./tsconfig.lib.json --declarationDir lib/esm",
"build": "yarn build-cjs && yarn build-esm",
"prepublishOnly": "rm -rf lib && yarn build",
"test": "ava",
Expand Down
8 changes: 6 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"noImplicitAny": true,
"allowJs": true,
"target": "esnext",
"module": "esnext",
"lib": ["esnext","dom"],
"module": "nodenext",
"moduleResolution": "nodenext",
"alwaysStrict": true,
"skipLibCheck": true,
Expand All @@ -16,7 +16,11 @@
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"typeRoots": ["./node_modules/@types", "./@types"]
"typeRoots": ["./node_modules/@types", "./@types"],
"sourceMap": true,
"declaration": true,
"emitDeclarationOnly": true,
"outDir": "lib"
},
"include": ["src/**/*", "test/**/*.ts"],
"exclude": []
Expand Down
5 changes: 0 additions & 5 deletions tsconfig.lib.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"declaration": true,
"outDir": "lib",
"sourceMap": true
},
"include": ["src/**/*.ts"]
}

0 comments on commit 7871639

Please sign in to comment.