-
-
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
Can this package be bundled with Webpack for a Node project? #1187
Comments
This issue should be closed, since it's Webpack specific. @hassankhan, you might want to have a look at the webpack specific issue here: serverless-heaven/serverless-webpack#78. |
closing at the recommendation of @manueltimita - also I don't know, I have never bundled non-browser code with webpack. |
@hassankhan I'd be interested in any info you came up with, I can add it to the docs. |
Hi @brianc, I ended up using Knex so I don't know if it's any help, but my Webpack plugins configuration looks like this:
|
Thanks @hassankhan |
I've managed to successfully bundle this using I think the crucial parts are:
|
FWIW, I got webpack to compile by adding the following to my webpack config (I don't need
This removes attempted resolution of './native' in https://github.com/brianc/node-postgres/blob/v6.2.3/lib/index.js#L95 and https://github.com/brianc/node-postgres/blob/v6.2.3/lib/index.js#L104. |
As pointed out by @hassankhan, same fix here |
Hi there,
I'm trying to build a Webpack bundle for an AWS Lambda project and I'm running into a few errors. I have a common package and a project package. The common package sets up a connection and returns a client from
pg
. The project package uses the client to actually execute queries. Currently I'm trying to bundlepg
in the common package, but I've also tried setting it as an external with not much difference 😢 I've included the error I get when I try and build my project:Webpack configuration for common package:
Webpack configuration for project package:
The text was updated successfully, but these errors were encountered: