Working on my project called "portal" has been quite an interesting journey. As I delved deeper into development, I realized the need for multiple projects within the repository. This led me to restructure my project setup like this:
https://i.sstatic.net/pdR7e.png
A question popped up in my mind - is it feasible to place the "tsconfig.json" file outside both the "portal" and "shop" directories so that TypeScript compiler options can be applied across all projects? When I tried running 'npm run serve' on the portal project, an error message made its way onto my screen:
Error: Cannot find "C:\Git\ui\portal\tsconfig.json" file. Please check webpack and ForkTsCheckerWebpackPlugin configuration.
Possible errors:
- wrong `context` directory in webpack configuration (if `tsconfig` is not set or is a relative path in fork plugin configuration)
- wrong `tsconfig` path in fork plugin configuration (should be a relative or absolute path)
This error left me puzzled because nowhere in my codebase had I defined such a filepath.
The "tsconfig.json" file contains the following configurations:
{
"compilerOptions": {
"target": "ES2020",
"module": "ESNext",
"strict": true,
...
},
"include": [
"portal/src/**/*.ts",
"portal/src/**/*.tsx",
"portal/src/**/*.vue"
],
"exclude": [
"node_modules"
]
}