forceExclude should apply to peerDependencies
This is a (Feature Proposal)
Description
-
What is the use case that should be solved? The forceExclude option currently only applies to devDependencies, but peerDependencies is a more appropriate place for aws-sdk. Putting it in devDependencies is a violation of the following lint rule: https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-extraneous-dependencies.md Can serverless-webpack be updated so that forceExclude also applies to peerDependencies?
-
If there is additional config how would it look No additional config required
Related issue(s):
- #393
Additional Data
- Serverless-Webpack Version you're using:5.5.5
- Webpack version you're using:5.60.0
- Serverless Framework Version you're using:2.64.1
- Operating System:Mac BigSur 11.6
- Stack Trace (if available): N/A
This is a breaking change, so we'd better have good reasons for that. PRs are welcomed.
Otherwise you may switch to a custom webpack.config.js to gain more control on which sections in package.json to exclude with webpack-node-externals, see the modulesFromFile#excludeFromBundle option.
Well, I would think forceExclude is the equivalent to "trust me bro, I know what I'm doing". Would allow me to nicely get rid of typescript and all the other stuff I don't want bundled and provide a nice escape hatch to all the issues brought by peerDependencies being bundled in