2

Currently the directory is like this,

src
stories
test

tsconfig.json

"compilerOptions": {
    "outDir": "lib",
    "rootDir": "src",
    "rootDirs": ["src", "stories"]
},
"exclude": ["node_modules", "build", "scripts"],
"include": ["src/**/*"]

This config has the right build result, which contains all the result from src. But all the type checking is all failed at stories directory.

If I add "stories" directory into "rootDir", the type checking is right, but the build result is not. So how I can config tsconfig.json to enable the type checking at "stories" directory, without affecting the build result, which is not including the "stories".

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.