-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Hot-reloading webpack assets in combination with SAM local #200
Comments
How would this scenario work on the cloud? Where would your webpack server live? We want to converge on an experience that is similar to your final cloud experience |
@sanathkr It wouldn't. The If you'd want to run a more production-like setup, you'd use |
Sounds good. So it is to give a tighter dev cycle for client-side apps. I have marked it as a feature request to gather feedback. And, if you haven't already noticed, I started some discussion in similar spirit. If you are interested in helping us build this, let me know. Happy to guide you through! |
Closing as there hasn't been any progress. If there are things we can still to tighten the dev loop, please open a new issue for that request. |
|
When writing a web app on top of a serverless backend, a really powerful setup for local development is almost possible using Webpack Dev Server and SAM Local.
Here's where I am now:
A couple of ways to tie all this up and make it work would be
Support CORS headers in SAM Local. I undersand it's being worked on on the SAM side of things, but I also appreciate that it's a complex problem. And I don't know if SAM Local starts supporting it OOTB when that feature lands, so there might be more work required here, too.
Support falling back to forwarding requests to a different host. Today, the
--static-dir
flag allows serving static assets for anything there isn't a configured endpoint for - maybe there could be a--forwarding-fallback
option (with a good name...)?The second option is intended to allow me to run
sam local start-api --forwarding-fallback localhost:3001
in one terminal, andwebpack-dev-server
in another, to serve SAM Local on 3000 and Webpack Dev Server on 3001. If I then go tolocalhost:3000
, it forwards the request to 3001, and sends the response back, yielding a client that thinks it's being served fromlocalhost:3000
and thus has no problem reaching the backend. This still allows for using Webpack's hot module reloading features for really rapid client-side development, while also having the backend available.What do you think - is this feasible, and if so, desirable?
The text was updated successfully, but these errors were encountered: