Background: /lib is where my local 'modules' folder is. These are modules that are not tied to the lambda function but are linked with npm link
Following Apex structure of lambda's, src is the containing dir for the "project" as per Apex.
Error can be found in the bundle: /src/functions/hello/lib/index.js
line 263
Steps to reproduce:
- cd to /lib/mailer
npm install
thennpm run build
npm link
to globally link the mailer module- cd to
/
,npm link mailer
to link the module - cd to
/src/functions/hello
to simulate the builder before deployment in apex ../../../node_modules/.bin/webpack --config ../../../webpack.config.babel.js --display-error-details --bail --progress
to run webpack.- Now go check
/src/functions/hello/lib/index.js
(this is where the compiled js should be after webpack bundles it up) - Find 'webpackMissingModule() on line 263' - I cannot get rid of this error, for some reason webpack will not link it with the postmark client...
My whole goal is to use webpack as a nice bundling utility before I upload lambda functions with apex. Due to being mainly a solo developer I want to use npm link to show realtime changes to any modules I create, but right now I cannot get webpack to link in my symlinks.
Any help is much appreciated!