Skip to content
This repository has been archived by the owner on Jun 8, 2023. It is now read-only.

Commit

Permalink
fix: Fix Build Issue (#7)
Browse files Browse the repository at this point in the history
* get rid of the annoying no emit

* no more isolated module

* use a custom tsconfig instead.

* fix tsconfig setup

* fix formatting

* tsconfig.lib used in build

* lib folder
  • Loading branch information
Tiernebre committed Jun 18, 2021
1 parent 74b9d7d commit db2a328
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 21 deletions.
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
"url": "https://github.com/Tiernebre/kecleon.git"
},
"scripts": {
"clean": "rm -rf ./lib",
"build": "tsc",
"clean": "rimraf ./lib",
"prebuild": "yarn clean",
"build": "tsc --p tsconfig.lib.json",
"format": "prettier --write .",
"lint": "prettier --check . && eslint . --max-warnings=0",
"test": "react-scripts test",
Expand Down Expand Up @@ -84,7 +85,8 @@
"@storybook/react": "^6.2.9",
"eslint-config-prettier": "^8.3.0",
"lint-staged": ">=10",
"prettier": "^2.3.1"
"prettier": "^2.3.1",
"rimraf": "^3.0.2"
},
"resolutions": {
"babel-loader": "8.1.0"
Expand Down
23 changes: 5 additions & 18 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"outDir": "lib",
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
Expand All @@ -14,20 +12,9 @@
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"jsx": "react-jsx",
"allowJs": true,
"skipLibCheck": true,
"isolatedModules": true,
"noEmit": true
"noEmit": true,
"jsx": "react-jsx"
},
"include": ["src"],
"exclude": [
"node_modules",
"**/*.test.ts",
"**/*.test.tsx",
"**/*.stories.tsx",
"./src/stories/**/*",
"./src/setupTests.ts"
],
"files": ["./src/index.ts"]
"include": ["src"]
}
22 changes: 22 additions & 0 deletions tsconfig.lib.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "lib",
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"allowJs": false,
"skipLibCheck": true,
"noEmit": false
},
"include": ["src"],
"exclude": [
"node_modules",
"**/*.test.ts",
"**/*.test.tsx",
"**/*.stories.tsx",
"./src/stories/**/*",
"./src/setupTests.ts"
],
"files": ["./src/index.ts"]
}

0 comments on commit db2a328

Please sign in to comment.