-
Notifications
You must be signed in to change notification settings - Fork 230
Build shared .ts files #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Is there a solution/workaround for this? |
I only found a workaround:
|
Thanks @joshinator. I considered that path but my project has a backend, frontend, lambdas and shared folder and so I didn't want to corrupt the project by enveloping it with serverless configurations at the root. The workaround I used was to use yarn link for the shared package and treat it like an independent package. I personally think this is a slightly cleaner approach.
|
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?
The text was updated successfully, but these errors were encountered: