dougmoscrop / serverless-plugin-include-dependencies

MIT License
184 stars 40 forks source link

serverless-plugin-typescript #27

Open 3boysdad opened 5 years ago

3boysdad commented 5 years ago

I haven't completely narrowed down the problem, but I've noticed that when using serverless-plugin-typescript, this plugin will not include any necessary dependencies. for instance...here's my package.json file

{ "devDependencies": { "@3boysdad/serverless-plugin-typescript": "^1.2.0", "@types/aws-sdk": "^2.7.0", "@types/lodash": "^4.14.120", "@types/node": "^10.12.21", "@types/nodemailer": "^4.6.5", "aws-sdk": "^2.395.0", "serverless-offline": "^4.2.1", "serverless-plugin-include-dependencies": "^3.2.1" }, "dependencies": { "axios": "^0.18.0", "js-base64": "^2.5.1", "lodash": "^4.17.11", "md5": "^2.2.1", "nodemailer": "^5.1.1", "regex": "^0.1.1" } }

I need modules like nodemailer, md5, js-base64 included. in a pure javascript solution this doesn't seem to an issue - I can can plainly see that these appear in the node_modules directory in my lambda function. But when using typescript none of the libraries are included. A workaround is to include what I need, and hope I got them all or simply include everything and defeat the purpose of this wonderful plugin. Thoughts/suggestions/anyone else run into this?

3boysdad commented 5 years ago

here's a follow-up to this. i had to make some updates to some old, on workstation that haven't changed any of includes. i uploaded the changes and nothing worked. went to go look and the node_modules directory wasn't present. this was in a plan javascript project. still doing some research, but i can't think of a good reason this would just stop working all of a sudden.

3boysdad commented 5 years ago

so i tried a simple case...https://github.com/3boysdad/TestServerless the handler will throw an exception when attempting to load. i must be missing obvious/stupid here. as i know this has worked for me in the past.

dougmoscrop commented 5 years ago

That simple example should certainly load; you can try running eslint . on your source and also node index.js just to see how it loads locally to rule out any possible typos and so on