-
-
Notifications
You must be signed in to change notification settings - Fork 172
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
would be cool to see a lerna + typescript + serverless-webpack example #50
Comments
I have an example working. However, I am seeing an error on the @example/lib dependancy... offline: Failure: Module parse failed: The keyword 'interface' is reserved (11:0) |
I haven't used serverless-webpack, but would the example be different from the included webpack example?
Usually this means your loaders are not set up to compile code outside the current module. Notice how the loader in the example doesn't have an |
I'm on the same path, trying to use a monorepo with typescript and serverless webpack. This basically works with the webpack example. But in most serverless projects I did, sooner or later I encountered some webpack-incompatible modules. But if you want to exclude some webpack-incompatible packages, the example does not work any more. If you exclude them in webpack.config.js with
you'll get a runtime error
After this I tried to set the node_modules path to the root in the serverless webpack config:
This leads to a webpack compile time error: Not sure why, but I believe this is due to the way serverless-webpack handles dependencies. I believe they try to bundle with webpack and do an npm install in the webpack ouput folder. I extended the repo to showcase this (NPM branch): https://github.com/florianbepunkt/ts-monorepo/tree/npm In case anyone finds a solution for this, a heads up would be nice. |
I managed to build a perfect solution using workspaces and serverless-optimize. The only complication was that mongodb needs to be extracted into a lambda layer and installed locally as a devDep. |
@derek-lewis Do you have an example repo by any chance? |
I will look to get an example repo up for you 👍🏼 |
@derek-lewis i have created a pull request for serverless application #303 |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Would be great to see an example of:
/example
--/lib/test.ts
--/serverless-api (AWS API Gateway)
--- depends on @example/core
The text was updated successfully, but these errors were encountered: