-
Notifications
You must be signed in to change notification settings - Fork 7
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
chore(webpack): compile JS with webpack - EUBFR-7 #4
Conversation
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.
Works really well in overall, only questions to ask :)
services/example01/package.json
Outdated
"version": "0.0.1", | ||
"scripts": { | ||
"deploy-function": | ||
"AWS_ACCESS_KEY_ID=foobar AWS_SECRET_ACCESS_KEY=foobar SLS_DEBUG=* serverless deploy function -f hello", |
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.
These are ok temporarily to test quickly, though it's risky as it's easy to commit secrets. I'd suggest adding a line in the readme about configuring a profile
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.
This is definitely for testing purpose and we should indeed manage secrets carefully. Since we don't have real code there and we don't use the actual api, it's not harmful, it just serves as an example
const path = require('path'); | ||
|
||
module.exports = { | ||
entry: slsw.lib.entries, |
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.
I checked the documentation for the serverless-webpack
but I didn't manage to understand what would be the workflow if there is an additional library which is to be developed separately from the main handler? For example, 1 file in lib
contains an export of a single function which is imported in the handler, would the lib file be ok with the babel run-time transpiration if the handler is not called?
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.
Serverless has been updated during the weekend, I don't know which documentation you read but:
- AFAIK the code is not transpiled during runtime, it is transpiled before being deployed
- you can
import myFunction from 'helper.js'
and if there's no call tomyFunction
, the code won't be imported (tree-shaking)
But maybe I've missed your point
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.
Works well, thank you!
Enjoy the power of ES6/7! 🎉