diff --git a/package.json b/package.json index 024c90eadf..2d7aea3a28 100644 --- a/package.json +++ b/package.json @@ -20,10 +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", + "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", diff --git a/tsconfig.compile.json b/tsconfig.compile.json new file mode 100644 index 0000000000..5eb927bc92 --- /dev/null +++ b/tsconfig.compile.json @@ -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" + ] +} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 8e88bdcdc4..7c96b2bf14 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "declaration": true, "declarationDir": "./build", - "emitDeclarationOnly": true, + "noEmit": true, "module": "esnext", "target": "es5", "lib": ["dom", "ESNext"],