Skip to content

Build shared .ts files #87

Open
Open
@joshua-holly89

Description

@joshua-holly89

Hi!

I have shared code in my project, e.g. a folder structure like this:
/shared
shared1.ts
shared2.ts
/microservice1
/node_modules
package.json
microservice1.ts
tsconfig.json
serverless.yml
/microservice2
/node_modules
package.json
microservice2.ts
tsconfig.json
serverless.yml

According to what I read it is not possible to pass a YAML file via command line to serverless deploy / offline start. So the current working directory has to be inside "/microservice1" or "/microservice2".

This results in not being able to build with error:
'File '...shared1.ts' is not under 'rootDir' '...microservice1'. 'rootDir' is expected to contain all source files.',

I also can not set rootDir in tsconfig.json to "../" since it is overwritten with default './'. So the only work around I see is to work with symlinks which is IMHO a little hacky.

So is there a possibility to build these shared files?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions