serverless-plugin-typescript: Don't copy devDependencies
there is an issue about this problem but it’s closed. https://github.com/graphcool/serverless-plugin-typescript/issues/13
Some other ppl and I still have the problem in that issue. So just to reopen it here.
package.json
{
"name": "aws-credentials-exp",
"version": "1.0.0",
"description": "",
"main": "handler.js",
"dependencies": {
"aws-sdk": "^2.201.0"
},
"devDependencies": {
"serverless-plugin-typescript": "^1.1.5"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
}
serverless-plugin-typescript is not in the final release, but typescript and the dependencies of typescript do.
I tried not to include serverless-plugin-typescript plugin in serverless.yml (it’s still installed and exist in package.json), the node_modules in zip file will only have aws-sdk and its dependencies.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 10
- Comments: 16 (6 by maintainers)
Commits related to this issue
- fix: exclude development dependencies during packaging Includes a refactor of the hooks property and class structure to "modularise" everything for better readability/lifecycle configuration as we're... — committed to serverless/serverless-plugin-typescript by JackCuthbert 5 years ago
- fix: exclude development dependencies during packaging Includes a refactor of the hooks property and class structure to "modularise" everything for better readability/lifecycle configuration as we're... — committed to serverless/serverless-plugin-typescript by JackCuthbert 5 years ago
- fix: exclude development dependencies during packaging Includes a refactor of the hooks property and class structure to "modularise" everything for better readability/lifecycle configuration as we're... — committed to serverless/serverless-plugin-typescript by JackCuthbert 5 years ago
- fix: exclude development dependencies during packaging Includes a refactor of the hooks property and class structure to "modularise" everything for better readability/lifecycle configuration as we're... — committed to serverless/serverless-plugin-typescript by JackCuthbert 5 years ago
- fix: exclude development dependencies during packaging Includes a refactor of the hooks property and class structure to "modularise" everything for better readability/lifecycle configuration as we're... — committed to serverless/serverless-plugin-typescript by JackCuthbert 5 years ago
I can get dependencies excluding correctly by downgrading to npm 5.0.4. Anything higher and only top level is excluded.
I really need this issue fixed. I see that there are several pull requests to fix this. May we have them merged?
Thank you!
@JackCuthbert Here is what I did for the workaround https://gist.github.com/ajmath/db7a1210cf9e01403e3dfb6004c1b89a
🎉 This issue has been resolved in version 1.1.8 🎉
The release is available on:
Your semantic-release bot 📦🚀
I’m also seeing this issue on on both my dev box (macOS High Sierra) and in the build container (node:carbon-alpine). Both are using: npm: 5.6.0 sls: 1.27.2 serverless-plugin-typescript: 1.1.5 yarn: 1.6.0
I’m seeing the same symptoms where
npm ls --dev=true --parseable=true --long=false --silentreturns the full list when run in the service directory and returns only the top-level dev dependencies in.buildThis breaks due to the symlinking, at least on Windows.
Serverless runs this command to discover dependencies.
Try running that command in the project’s root, then
cd .buildand do it again. All transitive dependencies are missing from the latter invocation. (You need to do this when the.build/node_modulessymlink exists)