I'm sorry for my bad english XD I hope to explain myself good.
I'm building a full-stack typescript project like this:
./
package.json
src/
_shared/
extensions/
date-extension.ts
object-extension.ts
string-extension.ts
restapi/
dist/
[...]
src/
[...]
tsconfig.json
package.json
package-lock.json
weapp/
dist/
[...]
src/
[...]
tsconfig.json
package.json
package-lock.json
in this moment the folder ./src/_shared/extensions is present in both ./src/webapp (frontend) and ./src/restapi (backend), both projects are separate projects (so they have their own node_modules folder and package.json file) but both have the same extension methods for string, object and Date types.
Actually in restapi project my tsconfig looks like this:
{
"compilerOptions": {
"experimentalDecorators": false,
"target": "es6",
"module": "commonjs",
"sourceMap": true,
"outDir": "./dist",
"strict": true,
"esModuleInterop": false,
"forceConsistentCasingInFileNames": true,
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true,
"baseUrl": "src",
"paths": {
"@src/*": [
"./*"
],
"@shared/*": [
"../../_shared/*"
]
}
},
"include": [
"./src/**/*",
"../../_shared/**/*"
],
"exclude": [
"./node_modules",
"**/*.spec.ts"
]
}
[EDIT] but the compiler create a ./dist folder like this:
./dist
_shared/
extensions/
[...]
restapi/
src/
[...]
If I move ./src/_shared/extensions into ./src/restapi/src folder, the compiler create a ./dist folder like this:
./dist
[...]
How can I reference ./src/_shared folder into my projects keeping the _shared folder outside my project root?
Thanks to all as always! :)