Sam Hulick
08/25/2021, 3:26 AMsrc
is a workspace.. in other words, all the Lambda & other business logic stuff in src has its own set of packages and tsconfig.
src/tsconfig.json
looks like this:
{
"extends": "../tsconfig.json",
"compilerOptions": {
"baseUrl": ".",
"paths": {
"~/*": ["./*"]
},
},
"include": ["**/*", "../environment.d.ts"]
}
but when I do yarn build
, I get this error:
> src/core/trash/purge-deleted-items.ts:9:30: error: Could not resolve "~/libs/db" (mark it as external to exclude it from the bundle)
9 │ import { dataApi, knex } from '~/libs/db';
why is the path alias not working?Sam Hulick
08/25/2021, 3:27 AMyarn tsc --noEmit -p src
, it returns no errorsthdxr
08/25/2021, 3:37 AMSam Hulick
08/25/2021, 3:38 AMSam Hulick
08/25/2021, 3:38 AMconst trashCron = new sst.Cron(this, 'AutoTrashEmptier', {
job: 'src/core/trash/automated-purge.main',
schedule: this.stage === 'prod' ? 'rate(4 hours)' : 'rate(48 hours)',
});
Sam Hulick
08/25/2021, 3:38 AMsrcPath
for thisSam Hulick
08/25/2021, 3:38 AMSam Hulick
08/25/2021, 3:39 AMsrcPath: 'src'
Sam Hulick
08/25/2021, 3:39 AMapp.setDefaultFunctionProps
?Sam Hulick
08/25/2021, 3:46 AMsrcPath
manually everywhere? 😳 literally all the source code is in src/
I have no idea why I was doing that