Skip to content

Running serve command wipes out function code #8

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

Closed
alexmacarthur opened this issue Jan 29, 2018 · 3 comments
Closed

Running serve command wipes out function code #8

alexmacarthur opened this issue Jan 29, 2018 · 3 comments

Comments

@alexmacarthur
Copy link

Hopefully I'm not missing a configuration option or something...

When I run the serve command, the code in my /functions/whatever.js appears to be processed by Webpack, wiping out the precompiled code I had written. As a makeshift solution, I've wrapped been first copying the precompiled file to a different directory to preserve it, but would not like to keep that up long term.

@bcomnes
Copy link
Contributor

bcomnes commented Jan 29, 2018

Do you have an example repo or gist to clarify the issue? Not quite catching the full issue here.

@alexmacarthur
Copy link
Author

Actually, it looks like I just didn't read the documentation fully. It says here to, at build time, put them into the functions directory because everything in there is what gets run through Webpack.

https://functions-alpha--www.netlify.com/docs/lambda-functions/#configuring-the-functions-folder

I was having the same issue described here:
https://gitter.im/netlify/lambda-functions?at=5a5ccae15a9ebe4f758cb1d7

Closing because of this misunderstanding -- thx!

@bcomnes
Copy link
Contributor

bcomnes commented Jan 30, 2018

Cool, glad it worked out. And you are on gitter! 🙌

ahmedelgabri added a commit to ahmedelgabri/gabri.me that referenced this issue Mar 25, 2018
In order for `netlify-lambda` to run, I need to create a dev folder
because the functions folder is the output folder for webpack.

Check netlify/netlify-lambda#8 (comment)
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

No branches or pull requests

2 participants