mirror of
https://github.com/aleleba/create-react-component-library.git
synced 2026-07-04 06:11:20 -06:00
PR-733704: fix TypeScript errors in Cypress webpack build
Add tsconfig.cy.json that extends the main tsconfig but removes the rootDir restriction and adds Cypress types. Point ts-loader in webpack.cy.config.ts to this dedicated tsconfig, fixing: - TS6059: cypress/support files outside rootDir src/components - TS2307: missing @storybook/react-webpack5 type declarations - TS2339: toBeInTheDocument not found (jest-dom types scope)
This commit is contained in:
13
tsconfig.cy.json
Normal file
13
tsconfig.cy.json
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"extends": "./tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"rootDir": ".",
|
||||||
|
"noEmit": true,
|
||||||
|
"types": ["cypress", "node"]
|
||||||
|
},
|
||||||
|
"include": [
|
||||||
|
"src",
|
||||||
|
"cypress",
|
||||||
|
"src/@types"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -50,7 +50,7 @@ export default {
|
|||||||
exclude: /node_modules/,
|
exclude: /node_modules/,
|
||||||
use: {
|
use: {
|
||||||
loader: 'ts-loader',
|
loader: 'ts-loader',
|
||||||
options: { transpileOnly: true },
|
options: { configFile: 'tsconfig.cy.json' },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user