-
Notifications
You must be signed in to change notification settings - Fork 4
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
Bundle server code with webpack #578
Bundle server code with webpack #578
Conversation
d6e051c
to
e6d19f9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
webpack: | ||
packager: 'yarn' | ||
webpackConfig: ./src/webpack/webpack.config.server.js | ||
includeModules: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If webpack builds a single JS bundle, that includes all the dependencies, why do you need to includeModules
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because there are still some packages not bundled with webpack due to incompatibilities. Those are defined in the externals
field of the webpack config.
This splits the deployment package into 2 ZIP files (one for each function), each is around ~7MB. The package size for
serveLogEndpoint
could be reduced even further if there was an easy way to makeserverless-webpack
respect the per-functioninclude
option of Serverless.Fixes #569