Skip to content

Commit

Permalink
build(tsconfig): refine ts.d file generation configuration, divide ts…
Browse files Browse the repository at this point in the history
… compule option from typecheck
  • Loading branch information
quino0627 committed Dec 12, 2021
1 parent f4992d9 commit f3ba4a0
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@
"lint": "npm run eslint-all && npm run stylelint-all",
"eslint-all": "eslint 'src/**/*.+(js|ts)?(x)'",
"stylelint-all": "stylelint src/**/*.styled.{js,ts}",
"typecheck": "ts-prune -e -p tsconfig.prune.json && tsc --emitDeclarationOnly --declarationDir build/src",
"typecheck": "ts-prune -e -p tsconfig.prune.json && tsc",
"test": "npm run lint && npm run typecheck && npm run jest",
"jest": "cross-env BABEL_ENV=test jest --maxWorkers=2",
"jest:watch": "cross-env BABEL_ENV=test jest --watch",
"cleanBuild": "npx rimraf build",
"prebuild": "npm run cleanBuild && npm run typecheck",
"compile": "tsc -p tsconfig.compile.json",
"prebuild": "npm run cleanBuild && npm run compile",
"build": "npm run build:icon && npm run build:rollup",
"build:rollup": "cross-env BABEL_ENV=build rollup -c",
"build:storybook": "build-storybook",
Expand Down
22 changes: 22 additions & 0 deletions tsconfig.compile.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"noEmit": false,
"emitDeclarationOnly": true,
"declarationDir": "./build/src"
},
"exclude": [
"./src/index.ts",
"./src/components/Icon/generated/**/*",
"./src/layout/stories/**/*",
"**/*.stories.tsx",
"**/*.test.ts",
"**/*.test.tsx",
"./src/__mocks__/**/*",
"./src/utils/storyUtils.ts",
"./src/utils/testUtils.tsx",
],
"files": [
"./src/index.ts"
]
}
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"declaration": true,
"declarationDir": "./build",
"emitDeclarationOnly": true,
"noEmit": true,
"module": "esnext",
"target": "es5",
"lib": ["dom", "ESNext"],
Expand Down

0 comments on commit f3ba4a0

Please sign in to comment.