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

node-lambda and Webpack #383

Open
merland opened this issue Nov 7, 2017 · 1 comment
Open

node-lambda and Webpack #383

merland opened this issue Nov 7, 2017 · 1 comment
Labels

Comments

@merland
Copy link

merland commented Nov 7, 2017

From the readme:

The --prebuiltDirectory flag is useful for working with Webpack for example. It skips npm install --> production and post_install.sh and simply packages the specified directory.

Where can I find more info about how to configure Webpack for use with node-lambda and the prebuiltDirectory flag? Simply placing the Webpack bundle.js in the prebuiltDirectory won't work. Anyone have an example?

@johnpangalos
Copy link

johnpangalos commented Nov 10, 2017

Hey,

So there are a few little setup config values you are going to need to set.

In Webpack

  • target='node'
  • output: {..., libraryTarget: 'umd'}

In your node-lambda .env/deploy-env

  • PACKAGE_DIRECTORY=[bundle folder]
  • AWS_HANDLER=[path to file without file extension].[name of exported function]

This let me run the script for testing. Still have to deploy my script so I'll update if there is anything I missed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants