Skip to content
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

Merged
merged 13 commits into from
Sep 11, 2017

Conversation

yhuard
Copy link
Contributor

@yhuard yhuard commented Sep 7, 2017

Enjoy the power of ES6/7! 🎉

@yhuard yhuard requested a review from a team September 7, 2017 12:07
@degliwe degliwe self-assigned this Sep 7, 2017
Copy link
Contributor

@kalinchernev kalinchernev left a 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 :)

"version": "0.0.1",
"scripts": {
"deploy-function":
"AWS_ACCESS_KEY_ID=foobar AWS_SECRET_ACCESS_KEY=foobar SLS_DEBUG=* serverless deploy function -f hello",
Copy link
Contributor

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

Copy link
Contributor Author

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,
Copy link
Contributor

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?

Copy link
Contributor Author

@yhuard yhuard Sep 11, 2017

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 to myFunction, the code won't be imported (tree-shaking)

But maybe I've missed your point

Copy link
Contributor

@kalinchernev kalinchernev left a 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!

@kalinchernev kalinchernev merged commit f10bf01 into master Sep 11, 2017
@kalinchernev kalinchernev deleted the chore/webpack branch September 11, 2017 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants